diff options
| author | Rahad Bhuiya <rahadbhuiya2021@gmail.com> | 2026-11-07 00:03:53 +0600 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-11-06 08:10:18 -1000 |
| commit | 564405c424f49d70b13debe7fe5b550234ad6b84 (patch) | |
| tree | e029b221c9ad1a0de2350269388d3a8187e47f65 /rust/kernel/alloc/allocator | |
| parent | 3133107d98057595c0af39ff907c852134926912 (diff) | |
sched_ext: Reset task fields on exit of an SCX_TASK_READY task
Tasks in SCX_TASK_READY are attached to a scheduler but outside the ext
class, such as RT/DL tasks, or non-SCHED_EXT tasks under a partial switch.
The scheduler's BPF code can still update their dsq_vtime and slice (for
instance, via ops.cgroup_move() as done by scx_flatcg).
Because __scx_disable_and_exit_task() currently breaks out of the state
switch for SCX_TASK_READY without calling scx_reset_task_fields(), these
fields are not cleared when the task leaves the scheduler. If the task is
subsequently moved to another cgroup/sub-scheduler and later switches to
SCHED_NORMAL, the new scheduler's ops.enable() sees stale dsq_vtime from
the previous scheduler's clock.
Call scx_reset_task_fields() in the SCX_TASK_READY case of
__scx_disable_and_exit_task() to ensure SCX-managed fields are properly
reset when leaving the scheduler.
Fixes: 5771e79e461e ("sched_ext: Reset dsq_vtime and slice when a task leaves SCX")
Signed-off-by: Rahad Bhuiya <rahadbhuiya2021@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'rust/kernel/alloc/allocator')
0 files changed, 0 insertions, 0 deletions
