]> git.ipfire.org Git - thirdparty/linux.git/commit
tools/sched_ext: Add scx_bpf_sub_dispatch() compat wrapper
authorCheng-Yang Chou <yphbchou0911@gmail.com>
Mon, 23 Mar 2026 15:17:33 +0000 (23:17 +0800)
committerTejun Heo <tj@kernel.org>
Mon, 23 Mar 2026 17:45:08 +0000 (07:45 -1000)
commitcb251eae7b0aec8a7924fb27bcb5b0388a3706bc
tree40d9ee858c3007a7707034f1ab746f307c6becd1
parentc50dcf533149e313a61d483769eb48682a1b0cdd
tools/sched_ext: Add scx_bpf_sub_dispatch() compat wrapper

Add a transparent compatibility wrapper for the scx_bpf_sub_dispatch()
kfunc in compat.bpf.h. This allows BPF schedulers using the sub-sched
dispatch feature to build and run on older kernels that lack the kfunc.

To avoid requiring code changes in individual schedulers, the
transparent wrapper pattern is used instead of a __COMPAT prefix. The
kfunc is declared with a ___compat suffix, while the static inline
wrapper retains the original scx_bpf_sub_dispatch() name.

When the kfunc is unavailable, the wrapper safely falls back to
returning false. This is acceptable because the dispatch path cannot
do anything useful without underlying sub-sched support anyway.

Tested scx_qmap on v6.14 successfully.

Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/sched_ext/include/scx/common.bpf.h
tools/sched_ext/include/scx/compat.bpf.h