mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCHSET sched_ext/for-7.5] sched_ext: Start ext_server from the tick
@ 2026-11-25 10:34 Tejun Heo
  2026-11-25 10:34 ` [PATCH 1/2] sched_ext: Start ext_server from the tick while a higher class holds the CPU Tejun Heo
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Tejun Heo @ 2026-11-25 10:34 UTC (permalink / raw)
  To: sched-ext
  Cc: David Vernet, Andrea Righi, Changwoo Min, Emil Tsalapatis,
	David Dai, Ingo Molnar, Peter Zijlstra, Juri Lelli,
	Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Valentin Schneider, K Prateek Nayak, Joel Fernandes,
	Hang Zhengyang, linux-kernel, Tejun Heo

Hello,

ext_server starts when the first task is enqueued on a CPU's rq and stops
when its pick finds no task. As the BPF scheduler can run a task on any CPU
whichever rq it is queued on, tasks can wait for a CPU whose ext_server has
stopped with no enqueue to start it again, and a higher class task which
keeps the CPU starves them until the watchdog fires. scx_central with a
SCHED_FIFO task spinning on a CPU shows it.

Peter pointed out the problem when ext_server was being added [1]. Hang's
recent patch which starts ext_server on every enqueue [2] helps but leaves
cases like the above.

This patchset also starts ext_server from the tick, while a higher class
task is running on the CPU:

- If the local DSQ has a task, right away. This covers a task which another
  CPU inserts after the pick came up empty.

- Otherwise, if any task is runnable on SCX, at most once a server period.
  Only ops.dispatch() can tell whether the BPF scheduler has a task for the
  CPU, and the server's pick calls it.

Whether any task is runnable comes from per-node counts of rqs which have
tasks, which a per-node timer lowers lazily, and a global count of such
nodes, which is all the tick reads.

This is a departure from how dl servers are usually driven and there may be
better ways to go about it, but it does seem to solve the problem properly
without adding much overhead.

With the patchset, a SCHED_EXT task sharing a CPU with a SCHED_FIFO hog gets
the server's share under both scx_simple and scx_central. The second patch
does the same from the remote tick for nohz_full CPUs.

Based on sched_ext/for-7.5 (cb31a095aab1).

This patchset contains the following 2 patches.

 0001 sched_ext: Start ext_server from the tick while a higher class holds the CPU
 0002 sched_ext: Start ext_server from the remote tick on nohz_full CPUs

The patchset is also available in the following git branch:

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git ext-server-tick

diffstat follows. Thanks.

 kernel/sched/core.c      |   5 +-
 kernel/sched/ext/ext.c   | 174 ++++++++++++++++++++++++++++++++++++++++++++++-
 kernel/sched/ext/ext.h   |   4 ++
 kernel/sched/ext/types.h |   1 +
 kernel/sched/sched.h     |   2 +
 5 files changed, 182 insertions(+), 4 deletions(-)

[1] https://lore.kernel.org/r/20260202195035.GG1282955@noisy.programming.kicks-ass.net
[2] https://lore.kernel.org/r/20261123-scx-dlsrv-v1-2-87c342d8246e@gmail.com

--
tejun

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

end of thread, other threads:[~2026-11-25 16:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-25 10:34 [PATCHSET sched_ext/for-7.5] sched_ext: Start ext_server from the tick Tejun Heo
2026-11-25 10:34 ` [PATCH 1/2] sched_ext: Start ext_server from the tick while a higher class holds the CPU Tejun Heo
2026-11-25 10:34 ` [PATCH 2/2] sched_ext: Start ext_server from the remote tick on nohz_full CPUs Tejun Heo
2026-11-25 13:57 ` [PATCHSET sched_ext/for-7.5] sched_ext: Start ext_server from the tick Peter Zijlstra
2026-11-25 16:56   ` Tejun Heo

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®