The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: David Vernet <void@manifault.com>,
	Andrea Righi <arighi@nvidia.com>,
	Changwoo Min <changwoo@igalia.com>
Cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	sched-ext@lists.linux.dev, Emil Tsalapatis <emil@etsalapatis.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCHSET sched_ext/for-7.3-arena-args] sched_ext: Convert arena-pointer interfaces to __arena arguments
Date: Wed, 12 Aug 2026 11:16:06 -1000	[thread overview]
Message-ID: <20260812211609.2495583-1-tj@kernel.org> (raw)

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

             reply	other threads:[~2026-08-12 21:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 21:16 Tejun Heo [this message]
2026-08-12 21:16 ` [PATCH 1/3] sched_ext: Pass kernel arena pointers to ops_cid callbacks Tejun Heo
2026-08-12 21:16 ` [PATCH 2/3] sched_ext: Convert sub-cap kfuncs to __arena cmask arguments Tejun Heo
2026-08-12 21:16 ` [PATCH 3/3] sched_ext: Convert scx_bpf_cid_override() to __arena array arguments Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260812211609.2495583-1-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=emil@etsalapatis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=memxor@gmail.com \
    --cc=sched-ext@lists.linux.dev \
    --cc=void@manifault.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox