mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: zhidao su <soolaugust@gmail.com>
To: sched-ext@lists.linux.dev
Cc: linux-kernel@vger.kernel.org, tj@kernel.org, void@manifault.com,
	arighi@nvidia.com, changwoo@igalia.com, peterz@infradead.org,
	mingo@redhat.com, zhidao su <suzhidao@xiaomi.com>
Subject: [PATCH 1/4] tools/sched_ext: compat.bpf.h: fix scx_bpf_dsq_reenq___compat signature
Date: Fri, 27 Mar 2026 04:42:35 +0800	[thread overview]
Message-ID: <20260326204238.3755737-2-suzhidao@xiaomi.com> (raw)
In-Reply-To: <20260326204238.3755737-1-suzhidao@xiaomi.com>

scx_bpf_dsq_reenq() is declared with KF_IMPLICIT_ARGS in the kernel BTF,
which means the BPF verifier automatically injects the
struct bpf_prog_aux *aux parameter.  The BPF-side weak symbol declaration
must NOT include the implicit parameter.

The previous declaration included an explicit aux__prog parameter, which
caused BPF programs calling scx_bpf_dsq_reenq() through the compat macro
to fail verification on kernels where the kfunc is available.

Fix the declaration to match the calling convention expected by the
verifier (2 parameters: dsq_id and reenq_flags).

Fixes: c50dcf533149 ("selftests/sched_ext: Add tests for SCX_ENQ_IMMED and scx_bpf_dsq_reenq()")
Signed-off-by: zhidao su <suzhidao@xiaomi.com>
---
 tools/sched_ext/include/scx/compat.bpf.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/sched_ext/include/scx/compat.bpf.h b/tools/sched_ext/include/scx/compat.bpf.h
index 654b566bd94a..6fbacc909b8b 100644
--- a/tools/sched_ext/include/scx/compat.bpf.h
+++ b/tools/sched_ext/include/scx/compat.bpf.h
@@ -405,7 +405,7 @@ static inline void scx_bpf_reenqueue_local(void)
  * v6.20: New scx_bpf_dsq_reenq() that allows re-enqueues on more DSQs. This
  * will eventually deprecate scx_bpf_reenqueue_local().
  */
-void scx_bpf_dsq_reenq___compat(u64 dsq_id, u64 reenq_flags, const struct bpf_prog_aux *aux__prog) __ksym __weak;
+void scx_bpf_dsq_reenq___compat(u64 dsq_id, u64 reenq_flags) __ksym __weak;
 
 static inline bool __COMPAT_has_generic_reenq(void)
 {
@@ -415,7 +415,7 @@ static inline bool __COMPAT_has_generic_reenq(void)
 static inline void scx_bpf_dsq_reenq(u64 dsq_id, u64 reenq_flags)
 {
 	if (bpf_ksym_exists(scx_bpf_dsq_reenq___compat))
-		scx_bpf_dsq_reenq___compat(dsq_id, reenq_flags, NULL);
+		scx_bpf_dsq_reenq___compat(dsq_id, reenq_flags);
 	else if (dsq_id == SCX_DSQ_LOCAL && reenq_flags == 0)
 		scx_bpf_reenqueue_local();
 	else
-- 
2.43.0


  reply	other threads:[~2026-03-26 20:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-26 20:42 [PATCH 0/4] sched_ext: fix three unreliable selftests and compat kfunc signature zhidao su
2026-03-26 20:42 ` zhidao su [this message]
2026-03-27  0:42   ` [PATCH 1/4] tools/sched_ext: compat.bpf.h: fix scx_bpf_dsq_reenq___compat signature Tejun Heo
2026-03-26 20:42 ` [PATCH 2/4] selftests/sched_ext: enq_immed: fix IMMED reenqueue livelock zhidao su
2026-03-26 20:42 ` [PATCH 3/4] selftests/sched_ext: dsq_reenq: fix reliability with two-DSQ design zhidao su
2026-03-26 20:42 ` [PATCH 4/4] selftests/sched_ext: consume_immed: fix reliability with CPU affinity zhidao su

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=20260326204238.3755737-2-suzhidao@xiaomi.com \
    --to=soolaugust@gmail.com \
    --cc=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=suzhidao@xiaomi.com \
    --cc=tj@kernel.org \
    --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®