[PATCHSET v5 sched_ext/for-6.11] sched_ext: Implement DSQ iterator

Tejun Heo
2024-07-09T00:40:48Z

DSQs are very opaque in the consumption path. The BPF scheduler has no way
of knowing which tasks are being considered and which is picked. This
patchset adds BPF DSQ iterator to allow BPF schedulers more flexibility in
how DSQs are used. See the 0002 patch for more details.

Changes from v4 (https://lore.kernel.org/all/Zn9oEjsm_1aWb35J@slm.duckdns.org/):

- Comment added to clarify use of naked list_empty(&dsq->list) test.

- scx_qmap changes separated into its own patch (0003).

There are no functional changes since v4. I'll apply these patches to
sched_ext/for-6.11 with the outstanding acks.

This patchset contains the following three patches:

0001-sched_ext-Take-out-priq-and-flags-from-scx_dsq_node.patch
0002-sched_ext-Implement-DSQ-iterator.patch
0003-sched_ext-scx_qmap-Add-an-example-usage-of-DSQ-itera.patch

and is also availalbe in the following git branch:

git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git scx-dsq-iter-v5

diffstat follows. Thanks.

include/linux/sched/ext.h | 13 +-
init/init_task.c | 2
kernel/sched/ext.c | 244 ++++++++++++++++++++++++++++++++++++++++++++++-------
tools/sched_ext/include/scx/common.bpf.h | 3
tools/sched_ext/scx_qmap.bpf.c | 25 +++++
tools/sched_ext/scx_qmap.c | 8 +
6 files changed, 259 insertions(+), 36 deletions(-)

--
tejun