public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] sched_ext: lockless peek operation for DSQs
@ 2025-10-02  2:57 Ryan Newton
  2025-10-02  2:57 ` [PATCH 1/3] sched_ext: Add " Ryan Newton
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ryan Newton @ 2025-10-02  2:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: tj, arighi, newton, Ryan Newton

This allows sched_ext schedulers an inexpensive operation to peek
at the first element in a queue (DSQ), without creating an iterator 
and acquiring the lock on that queue.

Note that manual testing has thus far included a modified version of the
example qmap scheduler that exercises peek, as well as a modified
modified LAVD (from the SCX repo) that exercises peek. The attached test
passes >1000 stress tests when run in concurrent VMs, and when run
sequentially on the host kernel. Presently, tested on the below
workstation and server processors.
- AMD Ryzen Threadripper PRO 7975WX 32-Cores
- AMD EPYC 9D64 88-Core Processor

Initial experiments indicate a substantial speedup (on schbench) when
running an SCX scheduler with per-cpu DSQs and peeking each queue to
retrieve the task with the minimum vruntime across all the CPUs.

Ryan Newton (3):
  sched_ext: Add lockless peek operation for DSQs
  sched_ext: optimize first_task update logic
  sched_ext: Add a selftest for scx_bpf_dsq_peek

 include/linux/sched/ext.h                     |   1 +
 kernel/sched/ext.c                            |  55 ++++-
 tools/sched_ext/include/scx/common.bpf.h      |   1 +
 tools/sched_ext/include/scx/compat.bpf.h      |  19 ++
 tools/testing/selftests/sched_ext/Makefile    |   1 +
 .../selftests/sched_ext/peek_dsq.bpf.c        | 133 +++++++++++++
 tools/testing/selftests/sched_ext/peek_dsq.c  | 188 ++++++++++++++++++
 7 files changed, 396 insertions(+), 2 deletions(-)
 create mode 100644 tools/testing/selftests/sched_ext/peek_dsq.bpf.c
 create mode 100644 tools/testing/selftests/sched_ext/peek_dsq.c

-- 
2.51.0


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

end of thread, other threads:[~2025-10-02  7:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-02  2:57 [PATCH 0/3] sched_ext: lockless peek operation for DSQs Ryan Newton
2025-10-02  2:57 ` [PATCH 1/3] sched_ext: Add " Ryan Newton
2025-10-02  7:13   ` Andrea Righi
2025-10-02  2:57 ` [PATCH 2/3] sched_ext: optimize first_task update logic Ryan Newton
2025-10-02  7:27   ` Andrea Righi
2025-10-02  2:57 ` [PATCH 3/3] sched_ext: Add a selftest for scx_bpf_dsq_peek Ryan Newton

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