]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sched_ext: Don't enable non-ext tasks in the sub-sched task loops
authorTejun Heo <tj@kernel.org>
Thu, 16 Jul 2026 20:46:04 +0000 (10:46 -1000)
committerTejun Heo <tj@kernel.org>
Sat, 18 Jul 2026 07:29:27 +0000 (21:29 -1000)
commit5cdc928598095b2c7d5f265e5f21eadd1634bfbe
tree09eff9a4c120ff2092eebbadbb01066fa96ad894
parent8c13364db9c9a43ed286f3a8d0fb9477b1adc43c
sched_ext: Don't enable non-ext tasks in the sub-sched task loops

Root enable and scx_post_fork() enable a task only if it's on the ext class.
Tasks on other classes, possible under an SCX_OPS_SWITCH_PARTIAL root, are
left READY and enabled by switching_to_scx() when they switch over. The sub
enable-commit pass and the sub-disable re-home loop enable unconditionally,
so a fair-class READY task in the subtree becomes ENABLED while not on
sched_ext. A later switch to SCHED_EXT then trips the task state validation
WARN (ENABLED with the previous state not READY) and calls ops.enable() a
second time.

Gate scx_enable_task() on the task's class in both loops.

Fixes: 337ec00b1d9c ("sched_ext: Implement cgroup sub-sched enabling and disabling")
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
kernel/sched/ext/ext.c