[PATCHSET sched_ext/for-7.4] sched_ext: Report a sub-scheduler's attach-time ecaps before lifting its enable bypass
From: Tejun Heo
Date: Fri Oct 09 2026 - 05:45:23 EST
Hello,
A sub-scheduler learns which cids it holds through ops.sub_ecaps_updated(),
but the grants its parent makes when it attaches are reported only after its
enable bypass is lifted, which is also when its tasks are handed to it. So
it gets its first ops.enqueue() calls before it has been notified of a
single cid and has to hold the tasks somewhere until the grants arrive.
Patch 1 factors the per-cpu ecaps sync out of the dispatch-side drain so
that it can run from elsewhere. Patch 2 has the enable path report the
attach-time grants on every cpu while the sub-scheduler is still bypassing,
so that it has its complete cid view when the first task arrives.
Verified with a sub-scheduler attaching under a parent with tasks already
queued, with cids revoked and granted back while attached, and across detach
and re-attach: no task is rescued or stalled at attach, and the root
scheduler is unaffected. The ordering between the enable path, the per-cpu
syncs and the parent's grants was model-checked with TLC.
Based on sched_ext/for-7.4 (3d7c2f550eef).
This patchset contains the following 2 patches.
0001 sched_ext: Factor out sync_pcpu_ecaps()
0002 sched_ext: Report a sub-scheduler's attach-time ecaps before lifting its enable bypass
The patchset is also available in the following git branch:
git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git sub-attach-ecaps
diffstat follows. Thanks.
kernel/sched/ext/sub.c | 194 ++++++++++++++++++++++++++++++++++---------------
1 file changed, 134 insertions(+), 60 deletions(-)
--
tejun