[GIT PULL] sched_ext: Fixes for v7.0-rc2

From: Tejun Heo

Date: Tue Mar 03 2026 - 16:35:36 EST


Hello,

The following changes since commit 640c9dc72f21f325700a4b0f839ad568ff21c697:

tools/sched_ext: fix getopt not re-parsed on restart (2026-02-20 17:17:38 -1000)

are available in the Git repository at:

https://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git tags/sched_ext-for-7.0-rc2-fixes

for you to fetch changes up to b06ccbabe2506fd70b9167a644978b049150224a:

sched_ext: Fix starvation of scx_enable() under fair-class saturation (2026-03-03 11:10:40 -1000)

Note: There's a merge conflict in kernel/sched/ext_idle.c between
189f164e573e ("Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL
uses") from the slab tree and 2a064262eb37 ("sched_ext: Fix
out-of-bounds access in scx_idle_init_masks()") from this pull. The
former converts kcalloc() to kzalloc_objs() and the latter changes
num_possible_nodes() to nr_node_ids. The resolution is to take both:

/* before (master) */
scx_idle_node_masks = kzalloc_objs(*scx_idle_node_masks,
num_possible_nodes());

/* after (resolved) */
scx_idle_node_masks = kzalloc_objs(*scx_idle_node_masks,
nr_node_ids);

A test-merge branch is available at:

https://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git test-merge-for-7.0-rc2-fixes

----------------------------------------------------------------
sched_ext: Fixes for v7.0-rc2

- Fix starvation of scx_enable() under fair-class saturation by
offloading the enable path to an RT kthread.

- Fix out-of-bounds access in idle mask initialization on systems with
non-contiguous NUMA node IDs.

- Fix a preemption window during scheduler exit and a refcount underflow
in cgroup init error path.

- Fix SCX_EFLAG_INITIALIZED being a no-op flag.

- Add READ_ONCE() annotations for KCSAN-clean lockless accesses and
replace naked scx_root dereferences with container_of() in kobject
callbacks.

- Tooling and selftest fixes: compilation issues with clang 17,
strtoul() misuse, unused options cleanup, and Kconfig sync.

----------------------------------------------------------------
Cheng-Yang Chou (8):
selftests/sched_ext: Abort test loop on signal
selftests/sched_ext: Fix unused-result warning for read()
tools/sched_ext: scx_central: Remove unused '-p' option
tools/sched_ext: scx_sdt: Remove unused '-f' option
selftests/sched_ext: Remove duplicated unistd.h include in rt_stall.c
tools/sched_ext: Sync README.md Kconfig with upstream scx
tools/sched_ext: Add Kconfig to sync with upstream
sched_ext: Remove redundant css_put() in scx_cgroup_init()

David Carlier (3):
sched_ext: Fix out-of-bounds access in scx_idle_init_masks()
sched_ext: Fix SCX_EFLAG_INITIALIZED being a no-op flag
tools/sched_ext: fix strtoul() misuse in scx_hotplug_seq()

Tejun Heo (2):
sched_ext: Disable preemption between scx_claim_exit() and kicking helper work
sched_ext: Fix starvation of scx_enable() under fair-class saturation

Zhao Mengmeng (3):
tools/sched_ext: Add -fms-extensions to bpf build flags
selftests/sched_ext: Add -fms-extensions to bpf build flags
selftests/sched_ext: Fix peek_dsq.bpf.c compile error for clang 17

zhidao su (3):
sched_ext: Use READ_ONCE() for the read side of dsq->nr update
sched_ext: Replace naked scx_root dereferences in kobject callbacks
sched_ext: Use READ_ONCE() for plain reads of scx_watchdog_timeout

kernel/sched/ext.c | 101 +++++++++++++++++----
kernel/sched/ext_idle.c | 4 +-
kernel/sched/ext_internal.h | 2 +-
tools/sched_ext/Kconfig | 61 +++++++++++++
tools/sched_ext/Makefile | 2 +
tools/sched_ext/README.md | 6 --
tools/sched_ext/include/scx/compat.h | 7 +-
tools/sched_ext/scx_central.c | 2 +-
tools/sched_ext/scx_sdt.c | 2 +-
tools/testing/selftests/sched_ext/Makefile | 2 +
.../selftests/sched_ext/init_enable_count.c | 3 +-
tools/testing/selftests/sched_ext/peek_dsq.bpf.c | 4 +-
tools/testing/selftests/sched_ext/rt_stall.c | 1 -
tools/testing/selftests/sched_ext/runner.c | 3 +
14 files changed, 165 insertions(+), 35 deletions(-)
create mode 100644 tools/sched_ext/Kconfig

Thanks.

--
tejun