]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sched_ext: Reject sub-sched attachment to a disabled parent
authorTejun Heo <tj@kernel.org>
Tue, 10 Mar 2026 17:12:21 +0000 (07:12 -1000)
committerTejun Heo <tj@kernel.org>
Tue, 10 Mar 2026 17:12:21 +0000 (07:12 -1000)
commit6b4576b09714def33890e04ef49621bca3614bbf
tree7b5b52e341a40fc33eb18801bc7839b406c8b75b
parent6b36c4c2935c54d6a103389fad2a2a9d25591501
sched_ext: Reject sub-sched attachment to a disabled parent

scx_claim_exit() propagates exits to descendants under scx_sched_lock.
A sub-sched being attached concurrently could be missed if it links
after the propagation. Check the parent's exit_kind in scx_link_sched()
under scx_sched_lock to interlock against scx_claim_exit() - either the
parent sees the child in its iteration or the child sees the parent's
non-NONE exit_kind and fails attachment.

Fixes: ebeca1f930ea ("sched_ext: Introduce cgroup sub-sched support")
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
kernel/sched/ext.c