mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCHSET sched_ext/for-7.3-fixes] sched_ext: Fix keep-last for sub-scheduler tasks and two scx_qmap placement loops
@ 2026-09-05 16:09 Tejun Heo
  2026-09-05 16:09 ` [PATCH sched_ext/for-7.3-fixes 1/4] sched_ext: Rename sch to root_sch in dispatch_one() Tejun Heo
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Tejun Heo @ 2026-09-05 16:09 UTC (permalink / raw)
  To: David Vernet, Andrea Righi, Changwoo Min
  Cc: sched-ext, Emil Tsalapatis, linux-kernel, Tejun Heo

Hello,

Running scx_qmap as a sub-scheduler under scx_nitosis exposed a kernel bug
and two scx_qmap bugs:

- dispatch_one() decides whether to keep running @prev by testing the root
  scheduler's SCX_OPS_ENQ_LAST and bypass state. Those are properties of
  @prev's own scheduler, and put_prev_task_scx() acts on that scheduler.
  When the root sets the flag and @prev belongs to a sub-scheduler that
  doesn't, the task is not kept and is enqueued with SCX_ENQ_LAST to a
  scheduler that never opted in. This trips the WARN_ON_ONCE in
  put_prev_task_scx(), and the task is queued without a follow-up scheduling
  event, which can stall it. Patches 1-2 fix this.

- scx_qmap added SCX_ENQ_IMMED to its rescue inserts, which turns a rescue
  request into a regular placement on a time-shared cid and loops with the
  kernel's REENQ bounce until the reenqueue limit ejects the scheduler.
  Patch 3 fixes this.

- scx_qmap placed tasks from the delegation split alone, ahead of the caps
  in effect on the cpus, so highpri moves to a freshly granted cid were
  denied and bounced. Patch 4 fixes this.

This patchset contains the following four patches:

 0001 sched_ext: Rename sch to root_sch in dispatch_one()
 0002 sched_ext: Use @prev's scheduler for the keep decisions in dispatch_one()
 0003 sched_ext: scx_qmap: Do not add IMMED to rescue inserts
 0004 sched_ext: scx_qmap: Place only on cids whose caps are in effect

0001-0002 fix the kernel side. 0003-0004 fix scx_qmap.

The patchset is based on sched_ext/for-7.3-fixes (0a85182723b6) and is also
available in the following git branch:

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git sub-keep-last-rescue

diffstat follows. Thanks.

 kernel/sched/ext/ext.c         |  33 ++++++++------
 tools/sched_ext/scx_qmap.bpf.c | 101 ++++++++++++++++++++++++++++++-----------
 tools/sched_ext/scx_qmap.h     |   3 ++
 3 files changed, 97 insertions(+), 40 deletions(-)

--
tejun

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-09-05 19:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-05 16:09 [PATCHSET sched_ext/for-7.3-fixes] sched_ext: Fix keep-last for sub-scheduler tasks and two scx_qmap placement loops Tejun Heo
2026-09-05 16:09 ` [PATCH sched_ext/for-7.3-fixes 1/4] sched_ext: Rename sch to root_sch in dispatch_one() Tejun Heo
2026-09-05 16:09 ` [PATCH sched_ext/for-7.3-fixes 2/4] sched_ext: Use @prev's scheduler for the keep decisions " Tejun Heo
2026-09-05 16:09 ` [PATCH sched_ext/for-7.3-fixes 3/4] sched_ext: scx_qmap: Do not add IMMED to rescue inserts Tejun Heo
2026-09-05 16:09 ` [PATCH sched_ext/for-7.3-fixes 4/4] sched_ext: scx_qmap: Place only on cids whose caps are in effect Tejun Heo
     [not found]   ` <20260905162223.6EF521F00A3A@smtp.kernel.org>
2026-09-05 16:40     ` Tejun Heo
2026-09-05 19:24       ` Andrea Righi
2026-09-05 19:25 ` [PATCHSET sched_ext/for-7.3-fixes] sched_ext: Fix keep-last for sub-scheduler tasks and two scx_qmap placement loops Andrea Righi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®