Re: [PATCH sched_ext/for-7.2] sched_ext: Refactor scx_root_enable_workfn() enablement task migration
From: Cheng-Yang Chou
Date: Tue Apr 21 2026 - 21:53:36 EST
Hi Tejun,
On Tue, Apr 21, 2026 at 07:30:18AM -1000, Tejun Heo wrote:
> Thanks for the patch, but I don't think this makes the code better.
> scx_root_enable_workfn() is a linear setup sequence; length comes
> from the number of ordered steps, not from doing unrelated things.
> Each extracted helper has exactly one caller, so the split is pure
> code motion. The locking story and the error path both fragment
> across three functions, and small things drift - the TID_TO_TASK
> read moved from ops->flags to sch->ops.flags, which is equal today
> but sch->ops.flags is mutated elsewhere (SCX_OPS_HAS_CPU_PREEMPT),
> so the two sources aren't guaranteed to stay in sync.
I see your point about maintaining the linear sequence for better
auditability of the locking and error paths. You're also right about the
TID_TO_TASK drift - checking the immutable ops->flags is indeed the correct
approach.
Regarding the ordering of the task enablement sequence: do you think
it would be useful to be included in the kdoc?
Thanks for your time.
--
Cheers,
Cheng-Yang