From: Tejun Heo <tj@kernel.org>
To: Andrea Righi <arighi@nvidia.com>
Cc: David Vernet <void@manifault.com>,
Changwoo Min <changwoo@igalia.com>,
Emil Tsalapatis <emil@etsalapatis.com>,
sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 sched_ext/for-6.19] sched_ext: Use ___v2 suffix for new kfuncs and fix scx build errors
Date: Wed, 22 Oct 2025 06:34:50 -1000 [thread overview]
Message-ID: <aPkHqpPGZ-9EBGUz@slm.duckdns.org> (raw)
In-Reply-To: <20251022153610.20111-1-arighi@nvidia.com>
Hello,
On Wed, Oct 22, 2025 at 05:36:10PM +0200, Andrea Righi wrote:
> Following commit 2dbbdeda77a61 ("sched_ext: Fix scx_bpf_dsq_insert()
> backward binary compatibility"), consistently use the ___v2 suffix also
> to the new scx_bpf_dsq_insert_vtime() and scx_bpf_select_cpu_and()
> kfuncs.
It's a bit subtle but the assumption around ___VER is that that isn't (going
to be) visible to BPF users and will eventually be dropped. Here, it's a bit
different. The arg packing is something we'll need to do indefinitely unless
BPF lifts the limit on #args. So, we will continue to have the internal
kfunc which takes the packaged arguments and user-facing wrapper that hides
that. So, I think __ prefix (something more explicit works top - e.g.
argpack prefix or suffix) is a better option here.
> Introduce __COMPAT_scx_bpf_select_cpu_and() and
> __COMPAT_scx_bpf_dsq_insert_vtime(), to ensure schedulers can transition
> smoothly to the updated interfaces, and temporarily mirror the
> definitions of struct scx_bpf_select_cpu_and_args and struct
> scx_bpf_dsq_insert_vtime_args to prevent build failures on kernels where
> these structs are not yet defined.
Given that there is on capability difference between before and after from
the scheduler POV, I'm not sure we need to make __COMPAT explicit. There's
nothing really gained by adding the prefix. This has been evolving over
time, but I think a reasonable rule of thumb is:
If the SCX core introduces a new feature which may affect BPF scheduler
operations in a noticeable way, that feature should be gated behind
__COMPAT. The BPF scheduler using a __COMPAT prefixed interface should then
be able to handle cases where the feature is not implemented. If the BPF
scheduler depends on the new feature (ie. it doesn't want to stay
compatible with older kernels), it should use the interface without
__COMPAT.
Here, there is no noticeable feature difference before and after for
existing schedulers, so I don't think it's necessary to introduce __COMPAT
prefix.
Thanks.
--
tejun
next prev parent reply other threads:[~2025-10-22 16:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-22 9:38 [PATCH " Andrea Righi
2025-10-22 14:44 ` Emil Tsalapatis
2025-10-22 15:03 ` Andrea Righi
2025-10-22 15:36 ` [PATCH v2 " Andrea Righi
2025-10-22 16:34 ` Tejun Heo [this message]
2025-10-22 19:38 ` Andrea Righi
2025-10-22 20:27 ` 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=aPkHqpPGZ-9EBGUz@slm.duckdns.org \
--to=tj@kernel.org \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=emil@etsalapatis.com \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®