diff options
| author | Tejun Heo <tj@kernel.org> | 2026-02-04 10:07:55 -1000 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-02-04 12:22:11 -1000 |
| commit | 0eca95cba2b7bf7b7b4f2fa90734a85fcaa72782 (patch) | |
| tree | 737d3de2746ccc49a270fccfb2826bafffb4a153 /Documentation/CodingStyle | |
| parent | c9894e6f0160414b57e895332c580cf5c8da6780 (diff) | |
sched_ext: Short-circuit sched_class operations on dead tasks
7900aa699c34 ("sched_ext: Fix cgroup exit ordering by moving sched_ext_free()
to finish_task_switch()") moved sched_ext_free() to finish_task_switch() and
renamed it to sched_ext_dead() to fix cgroup exit ordering issues. However,
this created a race window where certain sched_class ops may be invoked on
dead tasks leading to failures - e.g. sched_setscheduler() may try to switch a
task which finished sched_ext_dead() back into SCX triggering invalid SCX task
state transitions.
Add task_dead_and_done() which tests whether a task is TASK_DEAD and has
completed its final context switch, and use it to short-circuit sched_class
operations which may be called on dead tasks.
Fixes: 7900aa699c34 ("sched_ext: Fix cgroup exit ordering by moving sched_ext_free() to finish_task_switch()")
Reported-by: Andrea Righi <arighi@nvidia.com>
Link: http://lkml.kernel.org/r/20260202151341.796959-1-arighi@nvidia.com
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'Documentation/CodingStyle')
0 files changed, 0 insertions, 0 deletions
