The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCHSET sched_ext/for-7.2-fixes] sched_ext: Fix core scheduling
@ 2026-08-07 21:02 Tejun Heo
  2026-08-07 21:02 ` [PATCH 1/6] sched/core: Handle pick_task() releasing the rq lock Tejun Heo
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Tejun Heo @ 2026-08-07 21:02 UTC (permalink / raw)
  To: David Vernet, Andrea Righi, Changwoo Min, sched-ext
  Cc: Emil Tsalapatis, Peter Zijlstra, ElXreno, linux-kernel

Hello,

sched_ext's core scheduling support has been broken since 4c95380701f5
("sched/ext: Fold balance_scx() into pick_task_scx()") made dispatch run
from inside ->pick_task(). Dispatching can release the rq lock, which lets
core-wide selections on the same core interleave and corrupt each other's
state - crashing on a cleared rq->core_pick or leaving a dequeued task
running, which wedges the machine:

  https://github.com/sched-ext/scx/issues/3715

The main fix (0006) makes the core-sched pick return RETRY_TASK whenever
its dispatch released the rq lock, so that a selection only ever commits
picks made under a continuously held lock. The preceding patches update
the core-sched pick to handle lock-dropping picks (0001-0002) and fix
adjacent breakages from the same fold that core scheduling support needs
(0003-0005).

 0001-sched-core-Handle-pick_task-releasing-the-rq-lock.patch
 0002-sched-core-Make-core-sched-flips-wait-for-in-flight-.patch
 0003-sched_ext-Replace-SCX_RQ_BAL_KEEP-with-a-dispatch-ve.patch
 0004-sched_ext-Fix-this_rq-assumptions-in-dispatch-kfuncs.patch
 0005-sched_ext-Count-rq-lock-releases-in-rq-scx.lock_drop.patch
 0006-sched_ext-Fix-rq-core_pick-corruption-under-core-sch.patch

Based on sched_ext/for-7.2-fixes (d4a00d61a5c2). The patchset is also
available in the following git branch:

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git coresched-fixes

diffstat follows.

 kernel/sched/core.c    |  49 ++++++--
 kernel/sched/ext/ext.c | 302 +++++++++++++++++++++++++++++++++++--------------
 kernel/sched/sched.h   |   5 +-
 3 files changed, 265 insertions(+), 91 deletions(-)

-- 
tejun

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

end of thread, other threads:[~2026-08-07 21:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07 21:02 [PATCHSET sched_ext/for-7.2-fixes] sched_ext: Fix core scheduling Tejun Heo
2026-08-07 21:02 ` [PATCH 1/6] sched/core: Handle pick_task() releasing the rq lock Tejun Heo
2026-08-07 21:02 ` [PATCH 2/6] sched/core: Make core-sched flips wait for in-flight selections Tejun Heo
2026-08-07 21:02 ` [PATCH 3/6] sched_ext: Replace SCX_RQ_BAL_KEEP with a dispatch verdict return Tejun Heo
2026-08-07 21:02 ` [PATCH 4/6] sched_ext: Fix this_rq() assumptions in dispatch kfuncs Tejun Heo
2026-08-07 21:02 ` [PATCH 5/6] sched_ext: Count rq lock releases in rq->scx.lock_drop_seq Tejun Heo
2026-08-07 21:02 ` [PATCH 6/6] sched_ext: Fix rq->core_pick corruption under core scheduling Tejun Heo

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