BPF List
 help / color / mirror / Atom feed
* [PATCH 0/6] sched_ext: fix kfunc, sub-sched, flatcg and idle-mask issues
@ 2026-11-12 13:09 Tao Cui
  2026-11-12 13:09 ` [PATCH 1/6] sched_ext: Reject DSQ iterator kfuncs in tracing programs Tao Cui
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Tao Cui @ 2026-11-12 13:09 UTC (permalink / raw)
  To: tj
  Cc: void, arighi, changwoo, liwanwu, usama.arif, sched-ext,
	linux-kernel, bpf, cui.tao, Tao Cui

From: Tao Cui <cuitao@kylinos.cn>

Hello,

This series fixes six issues in the sched_ext core, the scx_flatcg
example scheduler and the CID helpers. The core.c fixes travel as a
separate series.

The DSQ iterator kfuncs bpf_iter_scx_dsq_next() and
bpf_iter_scx_dsq_destroy() take the user DSQ's raw spinlock but stay
callable from tracing programs, so a tracing program running while
that lock is already held deadlocks the machine. scx_bpf_cid_node()
is documented to return NUMA_NO_NODE for an invalid cid but aborts
the scheduler instead. A sub-scheduler can declare
ops.cid_online()/cid_offline() and read its own caps from
ops.init_cids(), but hotplug callbacks are only delivered to the root
scheduler and the caps storage isn't up during a self-read, so the
callbacks never run and the self-read kills the scheduler.
scx_flatcg strands a cgroup off the rbtree on the ENQ_RACE path until
the watchdog kills the scheduler, and the built-in idle masks aren't
cleared on hotplug, leaving an offline CPU advertised as idle.

0001 rejects the two iterator kfuncs for tracing programs. 0002 makes
scx_bpf_cid_node() a benign lookup that returns the documented
NUMA_NO_NODE. 0003 returns -EBUSY from a pre-init self-read instead
of killing the scheduler. 0004 rejects the hotplug callback
declaration on sub-schedulers at load time. 0005 waits for the picker
to resolve on ENQ_RACE instead of stranding the cgroup. 0006 clears
the built-in idle masks in handle_hotplug() and gates the claim path
on cpu_online().

All six are verified in qemu with A/B runs against a stock kernel.

Based on sched_ext/for-next (5b740a72b55c).

Tao Cui (6):
  sched_ext: Reject DSQ iterator kfuncs in tracing programs
  sched_ext: Make scx_bpf_cid_node() a benign lookup for invalid cids
  sched_ext: Return -EBUSY from a pre-init scx_bpf_sub_caps() read
  sched_ext: Reject cid_online/cid_offline on sub-schedulers
  tools/sched_ext: scx_flatcg: Don't strand a cgroup on the ENQ_RACE
    path
  sched_ext: Clear the built-in idle masks on CPU hotplug transitions

 kernel/sched/ext/cid.c           | 10 ++++++++++
 kernel/sched/ext/ext.c           | 24 ++++++++++++++++++++++--
 kernel/sched/ext/idle.c          | 21 +++++++++++++++++++++
 kernel/sched/ext/idle.h          |  1 +
 kernel/sched/ext/internal.h      |  3 +++
 kernel/sched/ext/sub.c           | 19 ++++++++++---------
 tools/sched_ext/scx_flatcg.bpf.c | 17 +++++++++++++++--
 7 files changed, 82 insertions(+), 13 deletions(-)

-- 
2.53.0

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

end of thread, other threads:[~2026-11-12 17:34 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12 13:09 [PATCH 0/6] sched_ext: fix kfunc, sub-sched, flatcg and idle-mask issues Tao Cui
2026-11-12 13:09 ` [PATCH 1/6] sched_ext: Reject DSQ iterator kfuncs in tracing programs Tao Cui
2026-11-12 17:34   ` Tejun Heo
2026-11-12 13:09 ` [PATCH 2/6] sched_ext: Make scx_bpf_cid_node() a benign lookup for invalid cids Tao Cui
2026-11-12 17:34   ` Tejun Heo
2026-11-12 13:09 ` [PATCH 3/6] sched_ext: Return -EBUSY from a pre-init scx_bpf_sub_caps() read Tao Cui
2026-11-12 17:34   ` Tejun Heo
2026-11-12 13:09 ` [PATCH 4/6] sched_ext: Reject cid_online/cid_offline on sub-schedulers Tao Cui
2026-11-12 17:34   ` Tejun Heo
2026-11-12 13:09 ` [PATCH 5/6] tools/sched_ext: scx_flatcg: Don't strand a cgroup on the ENQ_RACE path Tao Cui
2026-11-12 13:26   ` sashiko-bot
2026-11-12 17:34   ` Tejun Heo
2026-11-12 13:09 ` [PATCH 6/6] sched_ext: Clear the built-in idle masks on CPU hotplug transitions Tao Cui
2026-11-12 13:32   ` sashiko-bot
2026-11-12 17:34   ` Tejun Heo
2026-11-12 17:34 ` [PATCH 0/6] sched_ext: fix kfunc, sub-sched, flatcg and idle-mask issues Tejun Heo

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