[PATCHSET sched_ext/for-7.4] sched_ext: Add ops.sub_cid_sched_updated()

From: Tejun Heo

Date: Mon Oct 05 2026 - 14:10:07 EST


Hello,

A parent sched that delegates cpus to sub-scheds has no way of telling how
much each delegatee is using them. A parent that sizes its delegations by
demand cannot measure it, and one that wants to hand a cid from one sub to
another cannot see which sub it would take the cid from.

Patch 1 adds ops.sub_cid_sched_updated(), invoked on a sched when what it
sees running on a cid changes: NONE when no task of its subtree runs there,
SELF for its own task, or a direct child's cgroup id. Changes inside a
child's subtree are not reported. The op costs one pointer compare per
context switch when the sched does not change and sits behind a static key
that is on only while a loaded sched implements the op.

Patch 2 sizes scx_qmap's cid range buffer for large machines and patch 3
makes it show the cid-time each participant actually used next to what the
partition allocated to it.

Based on sched_ext/for-7.4 (3521f92ddd5f).

This patchset contains the following 3 patches.

0001 sched_ext: Add ops.sub_cid_sched_updated() to report the sched running on a cid
0002 sched_ext: scx_qmap: Size the cid range buffer for large machines
0003 sched_ext: scx_qmap: Show actual cid use per participant

The patchset is also available in the following git branch:

git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git sub-cid-sched

diffstat follows. Thanks.

kernel/sched/ext/ext.c | 20 ++++-
kernel/sched/ext/internal.h | 29 +++++++
kernel/sched/ext/sub.c | 166 +++++++++++++++++++++++++++++++++++++++++
kernel/sched/ext/sub.h | 6 ++
kernel/sched/sched.h | 2 +
tools/sched_ext/scx_qmap.bpf.c | 87 ++++++++++++++++++++-
tools/sched_ext/scx_qmap.c | 42 +++++++++--
tools/sched_ext/scx_qmap.h | 11 +++
8 files changed, 352 insertions(+), 11 deletions(-)

--
tejun