[PATCHSET sched_ext/for-6.19] sched_ext: Deprecate ops.cpu_acquire/release()

From: Tejun Heo

Date: Fri Oct 24 2025 - 20:18:58 EST


The ops.cpu_acquire/release() callbacks are broken. They miss events under
multiple conditions and can't be fixed without adding global sched core hooks
that sched maintainers don't want. They also aren't necessary as BPF schedulers
can use generic BPF mechanisms like tracepoints to achieve the same goals.

The main use case for cpu_release() was calling scx_bpf_reenqueue_local() when
a CPU gets preempted by a higher priority scheduling class. This patchset makes
scx_bpf_reenqueue_local() callable from any context by adding deferred
execution support, which completely eliminates the need for cpu_acquire/release()
callbacks.

This patchset contains the following three patches:

0001-sched_ext-Split-schedule_deferred-into-locked-and-un.patch
0002-sched_ext-Factor-out-reenq_local-from-scx_bpf_reenqu.patch
0003-sched_ext-Allow-scx_bpf_reenqueue_local-to-be-called.patch

Based on sched_ext/for-6.19 (dcb938c45328).

Git tree: git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git scx-reenq-anywhere

kernel/sched/ext.c | 114 +++++++++++++++++++++++--------
kernel/sched/sched.h | 1 +
tools/sched_ext/include/scx/common.bpf.h | 1 -
tools/sched_ext/include/scx/compat.bpf.h | 23 +++++++
tools/sched_ext/scx_qmap.bpf.c | 38 ++++++++---
5 files changed, 136 insertions(+), 41 deletions(-)

--
tejun