diff options
| author | Tejun Heo <tj@kernel.org> | 2026-09-05 06:09:56 -1000 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-09-05 12:12:12 -1000 |
| commit | 90f19b2816f5d243a8daf36ca83d9d9d04f00e4c (patch) | |
| tree | 9c8013de9eb2fd9f9fbf3f64538aa5fcd8b82b19 /scripts/Makefile.thinlto | |
| parent | 3265ef0b670180b0b946d73ee9825d6d91e98a08 (diff) | |
| download | linux-next-90f19b2816f5d243a8daf36ca83d9d9d04f00e4c.tar.gz linux-next-90f19b2816f5d243a8daf36ca83d9d9d04f00e4c.zip | |
sched_ext: Use @prev's scheduler for the keep decisions in dispatch_one()
dispatch_one() tests ops flags and bypass state against the root scheduler
in both places where it decides to keep running @prev: the early keep of a
@prev with slice left tests the root's bypass state, and the keep-last at
the end tests the root's SCX_OPS_ENQ_LAST and bypass state. Both are
properties of the scheduler @prev belongs to, and put_prev_task_scx(), which
acts on the outcome, reads them from that scheduler. When @prev belongs to a
sub-scheduler the two sides disagree.
The keep-last case is visible. The root set SCX_OPS_ENQ_LAST, so a lone
@prev of a sub-scheduler is not kept and is enqueued with SCX_ENQ_LAST to a
sub-scheduler that never opted in. This trips the WARN_ON_ONCE in
put_prev_task_scx() for the missing flag, and the sub-scheduler queues the
task like any other and triggers no follow-up scheduling event, which can
lead to stalls.
Test SCX_OPS_ENQ_LAST and bypass state on @prev's sched in both places and
charge SCX_EV_DISPATCH_KEEP_LAST to it. Read the sched at each decision, as
the dispatch in between can drop the rq lock.
Fixes: 88234b075c3f ("sched_ext: Introduce scx_task_sched[_rcu]()")
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
