public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET sched_ext/for-7.1] sched_ext: Overhaul DSQ reenqueue infrastructure
@ 2026-03-06 19:06 Tejun Heo
  2026-03-06 19:06 ` [PATCH 01/15] sched_ext: Relocate scx_bpf_task_cgroup() and its BTF_ID to the end of kfunc section Tejun Heo
                   ` (16 more replies)
  0 siblings, 17 replies; 38+ messages in thread
From: Tejun Heo @ 2026-03-06 19:06 UTC (permalink / raw)
  To: linux-kernel, sched-ext; +Cc: void, arighi, changwoo, emil, Tejun Heo

scx_bpf_reenqueue_local() currently only supports the current CPU's local
DSQ and must be called from ops.cpu_release(). This patchset overhauls the
reenqueue infrastructure to support flexible, remote, and user DSQ reenqueue
operations through the new scx_bpf_dsq_reenq() kfunc.

The patchset:

- Refactors per-node data structures and DSQ lookup helpers as preparation.

- Converts the deferred reenqueue mechanism from lockless llist to a
  spinlock-protected regular list to support more complex list operations.

- Introduces scx_bpf_dsq_reenq() which can target any local DSQ including
  remote CPUs via SCX_DSQ_LOCAL_ON | cpu, and user-defined DSQs.

- Adds per-CPU data to DSQs and cursor-based iteration helpers to support
  user DSQ reenqueue with proper multi-rq locking.

- Adds reenqueue flags plumbing and a lockless fast-path optimization.

- Simplifies task state handling and adds SCX_TASK_REENQ_REASON flags so BPF
  schedulers can distinguish why a task is being reenqueued.

scx_bpf_reenqueue_local() is reimplemented as a wrapper around
scx_bpf_dsq_reenq(SCX_DSQ_LOCAL, 0) and may be deprecated in the future.

Based on sched_ext/for-7.1 (4f8b122848db).

Tejun Heo (15):
  sched_ext: Relocate scx_bpf_task_cgroup() and its BTF_ID to the end of kfunc section
  sched_ext: Wrap global DSQs in per-node structure
  sched_ext: Factor out pnode allocation and deallocation into helpers
  sched_ext: Change find_global_dsq() to take CPU number instead of task
  sched_ext: Relocate reenq_local() and run_deferred()
  sched_ext: Convert deferred_reenq_locals from llist to regular list
  sched_ext: Wrap deferred_reenq_local_node into a struct
  sched_ext: Introduce scx_bpf_dsq_reenq() for remote local DSQ reenqueue
  sched_ext: Add reenq_flags plumbing to scx_bpf_dsq_reenq()
  sched_ext: Add per-CPU data to DSQs
  sched_ext: Factor out nldsq_cursor_next_task() and nldsq_cursor_lost_task()
  sched_ext: Implement scx_bpf_dsq_reenq() for user DSQs
  sched_ext: Optimize schedule_dsq_reenq() with lockless fast path
  sched_ext: Simplify task state handling
  sched_ext: Add SCX_TASK_REENQ_REASON flags

Git tree:
  git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git scx-reenq

 include/linux/sched/ext.h                |  58 +-
 kernel/sched/ext.c                       | 882 ++++++++++++++++++++++---------
 kernel/sched/ext_internal.h              |  32 +-
 kernel/sched/sched.h                     |   4 +-
 tools/sched_ext/include/scx/compat.bpf.h |  21 +
 tools/sched_ext/scx_qmap.bpf.c           |  68 ++-
 tools/sched_ext/scx_qmap.c               |   5 +-
 7 files changed, 777 insertions(+), 293 deletions(-)

--
tejun

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

end of thread, other threads:[~2026-03-09 17:48 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-06 19:06 [PATCHSET sched_ext/for-7.1] sched_ext: Overhaul DSQ reenqueue infrastructure Tejun Heo
2026-03-06 19:06 ` [PATCH 01/15] sched_ext: Relocate scx_bpf_task_cgroup() and its BTF_ID to the end of kfunc section Tejun Heo
2026-03-06 20:45   ` Emil Tsalapatis
2026-03-06 23:20   ` Daniel Jordan
2026-03-06 19:06 ` [PATCH 02/15] sched_ext: Wrap global DSQs in per-node structure Tejun Heo
2026-03-06 20:52   ` Emil Tsalapatis
2026-03-06 23:20   ` Daniel Jordan
2026-03-06 19:06 ` [PATCH 03/15] sched_ext: Factor out pnode allocation and deallocation into helpers Tejun Heo
2026-03-06 20:54   ` Emil Tsalapatis
2026-03-06 23:21   ` Daniel Jordan
2026-03-06 19:06 ` [PATCH 04/15] sched_ext: Change find_global_dsq() to take CPU number instead of task Tejun Heo
2026-03-06 21:06   ` Emil Tsalapatis
2026-03-06 22:33   ` [PATCH v2 " Tejun Heo
2026-03-06 23:21   ` [PATCH " Daniel Jordan
2026-03-06 19:06 ` [PATCH 05/15] sched_ext: Relocate reenq_local() and run_deferred() Tejun Heo
2026-03-06 21:09   ` Emil Tsalapatis
2026-03-06 23:34   ` Daniel Jordan
2026-03-07  0:12   ` [PATCH v2 05/15] sched_ext: Relocate run_deferred() and its callees Tejun Heo
2026-03-06 19:06 ` [PATCH 06/15] sched_ext: Convert deferred_reenq_locals from llist to regular list Tejun Heo
2026-03-09 17:12   ` Emil Tsalapatis
2026-03-09 17:16     ` Emil Tsalapatis
2026-03-06 19:06 ` [PATCH 07/15] sched_ext: Wrap deferred_reenq_local_node into a struct Tejun Heo
2026-03-09 17:16   ` Emil Tsalapatis
2026-03-06 19:06 ` [PATCH 08/15] sched_ext: Introduce scx_bpf_dsq_reenq() for remote local DSQ reenqueue Tejun Heo
2026-03-09 17:33   ` Emil Tsalapatis
2026-03-06 19:06 ` [PATCH 09/15] sched_ext: Add reenq_flags plumbing to scx_bpf_dsq_reenq() Tejun Heo
2026-03-09 17:47   ` Emil Tsalapatis
2026-03-06 19:06 ` [PATCH 10/15] sched_ext: Add per-CPU data to DSQs Tejun Heo
2026-03-06 22:54   ` Andrea Righi
2026-03-06 22:56     ` Andrea Righi
2026-03-06 23:09   ` [PATCH v2 " Tejun Heo
2026-03-06 19:06 ` [PATCH 11/15] sched_ext: Factor out nldsq_cursor_next_task() and nldsq_cursor_lost_task() Tejun Heo
2026-03-06 19:06 ` [PATCH 12/15] sched_ext: Implement scx_bpf_dsq_reenq() for user DSQs Tejun Heo
2026-03-06 19:06 ` [PATCH 13/15] sched_ext: Optimize schedule_dsq_reenq() with lockless fast path Tejun Heo
2026-03-06 19:06 ` [PATCH 14/15] sched_ext: Simplify task state handling Tejun Heo
2026-03-06 19:06 ` [PATCH 15/15] sched_ext: Add SCX_TASK_REENQ_REASON flags Tejun Heo
2026-03-06 23:14 ` [PATCHSET sched_ext/for-7.1] sched_ext: Overhaul DSQ reenqueue infrastructure Andrea Righi
2026-03-07 15:38 ` Tejun Heo

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