From: Tejun Heo <tj@kernel.org>
To: sched-ext@lists.linux.dev
Cc: David Vernet <void@manifault.com>,
Andrea Righi <arighi@nvidia.com>,
Changwoo Min <changwoo@igalia.com>,
Emil Tsalapatis <emil@etsalapatis.com>,
David Dai <david.dai@linux.dev>,
linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>
Subject: [PATCHSET sched_ext/for-7.4] sched_ext: Add scx_bpf_dsq_reenq_task()
Date: Sat, 17 Oct 2026 12:37:35 -1000 [thread overview]
Message-ID: <20261017223738.993262-1-tj@kernel.org> (raw)
Hello,
A scheduler that loses the cpus serving a DSQ needs the tasks stranded on it
placed again, and only those. scx_bpf_dsq_reenq() re-enqueues the whole DSQ:
every task goes back through ops.enqueue() and is re-placed and reordered.
The only per-task primitive, scx_bpf_dsq_move(), is a placement decision,
not a re-enqueue. A sub-scheduler sweeping its DSQs after a cap revoke is
one such caller.
Patch 1 factors the rq lock switch out of scx_dsq_move() so that the new
kfunc can share it. Patch 2 adds scx_bpf_dsq_reenq_task(), which marks a
task from a DSQ iteration. When the iteration ends, the DSQ's deferred
re-enqueue walk is scheduled once and re-enqueues only the marked tasks, in
DSQ order with SCX_ENQ_REENQ. The other tasks keep their positions.
The kfunc locks the task's rq and the DSQ like scx_bpf_dsq_move() and is
callable from the same contexts. The mark is cleared when the task leaves
the DSQ, so a task consumed before the walk is not re-enqueued.
Patch 3 makes scx_qmap re-enqueue some of the tasks stranded on its shared
DSQs with the new kfunc instead of moving them to the rescue path, so that
both kfuncs are exercised. They go back through ops.enqueue(), which rescues
them, and the other queued tasks keep their places.
Based on sched_ext/for-7.4 (9c0af54cb49c).
This patchset contains the following 3 patches.
0001 sched_ext: Factor out the rq lock switch of scx_dsq_move()
0002 sched_ext: Add scx_bpf_dsq_reenq_task() to re-enqueue single tasks from a DSQ iteration
0003 sched_ext: scx_qmap: Also re-enqueue stranded tasks with scx_bpf_dsq_reenq_task()
The patchset is also available in the following git branch:
git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git dsq-reenq-task
diffstat follows. Thanks.
include/linux/sched/ext.h | 1 +
kernel/sched/ext/ext.c | 142 ++++++++++++++++++++++++-------
kernel/sched/ext/internal.h | 2 +
tools/sched_ext/include/scx/common.bpf.h | 1 +
tools/sched_ext/include/scx/compat.bpf.h | 6 ++
tools/sched_ext/scx_qmap.bpf.c | 50 ++++++-----
6 files changed, 153 insertions(+), 49 deletions(-)
--
tejun
next reply other threads:[~2026-10-17 22:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-17 22:37 Tejun Heo [this message]
2026-10-17 22:37 ` [PATCH 1/3] sched_ext: Factor out the rq lock switch of scx_dsq_move() Tejun Heo
2026-10-17 22:52 ` Andrea Righi
2026-10-17 22:37 ` [PATCH 2/3] sched_ext: Add scx_bpf_dsq_reenq_task() to re-enqueue single tasks from a DSQ iteration Tejun Heo
2026-10-17 23:01 ` Andrea Righi
2026-10-17 23:35 ` [PATCH v2 " Tejun Heo
2026-10-17 22:37 ` [PATCH 3/3] sched_ext: scx_qmap: Also re-enqueue stranded tasks with scx_bpf_dsq_reenq_task() Tejun Heo
2026-10-17 23:06 ` Andrea Righi
2026-10-17 23:35 ` Tejun Heo
2026-10-18 6:14 ` Andrea Righi
2026-10-17 23:43 ` [PATCHSET sched_ext/for-7.4] sched_ext: Add scx_bpf_dsq_reenq_task() Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261017223738.993262-1-tj@kernel.org \
--to=tj@kernel.org \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=david.dai@linux.dev \
--cc=emil@etsalapatis.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sched-ext@lists.linux.dev \
--cc=void@manifault.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®