diff options
| author | zhidao su <suzhidao@xiaomi.com> | 2026-04-23 05:58:32 +0300 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-04-23 19:36:56 +0300 |
| commit | 4e3d7c89e15ac5dbf45b7d7a49bb374650c03339 (patch) | |
| tree | faefa7941bc8ef256d3ef7866798db61c62b6ec4 /include/linux | |
| parent | 05909810a946222aca5d0611d37be82d18f95228 (diff) | |
| download | linux-4e3d7c89e15ac5dbf45b7d7a49bb374650c03339.tar.xz | |
sched_ext: Fix local_dsq_post_enq() to use task's scheduler in sub-sched
local_dsq_post_enq() calls call_task_dequeue() with scx_root instead of
the scheduler instance actually managing the task. When
CONFIG_EXT_SUB_SCHED is enabled, tasks may be managed by a sub-scheduler
whose ops.dequeue() callback differs from root's. Using scx_root causes
the wrong scheduler's ops.dequeue() to be consulted: sub-sched tasks
dispatched to a local DSQ via scx_bpf_dsq_move_to_local() will have
SCX_TASK_IN_CUSTODY cleared but the sub-scheduler's ops.dequeue() is
never invoked, violating the custody exit semantics.
Fix by adding a 'struct scx_sched *sch' parameter to local_dsq_post_enq()
and move_local_task_to_local_dsq(), and propagating the correct scheduler
from their callers dispatch_enqueue(), move_task_between_dsqs(), and
consume_dispatch_q().
This is consistent with dispatch_enqueue()'s non-local path which already
passes 'sch' directly to call_task_dequeue() for global/bypass DSQs.
Fixes: ebf1ccff79c4 ("sched_ext: Fix ops.dequeue() semantics")
Signed-off-by: zhidao su <suzhidao@xiaomi.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
