[PATCHSET sched_ext/for-7.3-arena-args] sched_ext: Convert arena-pointer interfaces to __arena arguments

Tejun Heo <[email protected]>
Newsgroups dev.linux.lists.sched-ext,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
cid-form schedulers keep their data in the BPF arena, but the interfaces
that pass arena objects between the kernel and BPF predate the __arena
argument support that just landed in bpf-next: kfuncs took the pointers as
__ign scalars or verifier-checked buffers, and both sides rebased between
the address forms by hand.

Convert all of them to __arena arguments before cid-form schedulers start
seeing real use. The ops_cid set_cmask() and sub_caps_updated() callbacks
pass kernel arena addresses that the struct_ops trampoline converts, the
sub-cap kfuncs and scx_bpf_cid_override() receive rebased kernel pointers
directly, and the hand-rolled conversion helpers are removed. The BPF-side
declarations carry __arena-qualified pointers, so scx_qmap passes its arena
objects without casts.

The arena argument address translation is currently implemented only on
x86-64. cid-form schedulers using these interfaces load only there for now.

This patchset contains the following three patches:

 0001-sched_ext-Pass-kernel-arena-pointers-to-ops_cid-call.patch
 0002-sched_ext-Convert-sub-cap-kfuncs-to-__arena-cmask-ar.patch
 0003-sched_ext-Convert-scx_bpf_cid_override-to-__arena-ar.patch

and is based on sched_ext/for-7.3-arena-args (294d95ff251b), which is
for-7.3 with bpf-next d114bb989367 ("Merge branch
'add-arena-argument-support-to-kfuncs-and-struct_ops'") pulled in for the
__arena argument support. The patches are also available in the following
git branch:

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git arena-args

diffstat follows.

 kernel/sched/ext/arena.c                 |  3 +-
 kernel/sched/ext/cid.c                   | 60 +++++++++++++++-------------
 kernel/sched/ext/ext.c                   | 22 +++++------
 kernel/sched/ext/internal.h              | 19 ++-------
 kernel/sched/ext/sub.c                   | 53 ++++++++++++-------------
 kernel/sched/ext/types.h                 |  6 +--
 tools/sched_ext/include/scx/common.bpf.h | 11 +++---
 tools/sched_ext/include/scx/compat.bpf.h | 14 ++++---
 tools/sched_ext/scx_qmap.bpf.c           | 36 ++++++-----------
 tools/sched_ext/scx_qmap.c               | 68 +++++++++++++++++++-------------
 tools/sched_ext/scx_qmap.h               |  4 ++
 11 files changed, 148 insertions(+), 148 deletions(-)

--
tejun
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.