* [PATCH] sched_ext: Fix scx_bpf_dsq_move_to_local___v2 compat detection
@ 2026-08-11 8:11 Qiurong Fang
2026-08-14 19:49 ` Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: Qiurong Fang @ 2026-08-11 8:11 UTC (permalink / raw)
To: tj; +Cc: void, arighi, changwoo, sched-ext, linux-kernel, fangqiurong
From: fangqiurong <fangqiurong@kylinos.cn>
libbpf strips the last ___flavor suffix when resolving kfunc externs, so
the bare ___v2 declaration resolves to scx_bpf_dsq_move_to_local, whose
BTF proto lacks @enq_flags. The extern never matches, bpf_ksym_exists()
returns false on every kernel that has the ___v2 kfunc, and the macro
falls back to ___v1, silently dropping @enq_flags.
Add the trailing ___compat suffix used by the other versioned externs in
this file (scx_bpf_dsq_insert___v2, scx_bpf_reenqueue_local___v2).
scx_qmap passes needs_immed() as @enq_flags, so on time-shared cids the
SHARED_DSQ draining move currently drops SCX_ENQ_IMMED.
Fixes: e01a940b4813 ("sched_ext: Add enq_flags to scx_bpf_dsq_move_to_local()")
Assisted-by: Z.ai:glm-5.2
Signed-off-by: fangqiurong <fangqiurong@kylinos.cn>
---
tools/sched_ext/include/scx/compat.bpf.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/sched_ext/include/scx/compat.bpf.h b/tools/sched_ext/include/scx/compat.bpf.h
index cf469d5ff9ca..34eeb03afa2f 100644
--- a/tools/sched_ext/include/scx/compat.bpf.h
+++ b/tools/sched_ext/include/scx/compat.bpf.h
@@ -31,7 +31,7 @@ struct cgroup *scx_bpf_task_cgroup___new(struct task_struct *p) __ksym __weak;
*
* v7.1: scx_bpf_dsq_move_to_local___v2() to add @enq_flags.
*/
-bool scx_bpf_dsq_move_to_local___v2(u64 dsq_id, u64 enq_flags) __ksym __weak;
+bool scx_bpf_dsq_move_to_local___v2___compat(u64 dsq_id, u64 enq_flags) __ksym __weak;
bool scx_bpf_dsq_move_to_local___v1(u64 dsq_id) __ksym __weak;
void scx_bpf_dsq_move_set_slice___new(struct bpf_iter_scx_dsq *it__iter, u64 slice) __ksym __weak;
void scx_bpf_dsq_move_set_vtime___new(struct bpf_iter_scx_dsq *it__iter, u64 vtime) __ksym __weak;
@@ -45,8 +45,8 @@ bool scx_bpf_dispatch_from_dsq___old(struct bpf_iter_scx_dsq *it__iter, struct t
bool scx_bpf_dispatch_vtime_from_dsq___old(struct bpf_iter_scx_dsq *it__iter, struct task_struct *p, u64 dsq_id, u64 enq_flags) __ksym __weak;
#define scx_bpf_dsq_move_to_local(dsq_id, enq_flags) \
- (bpf_ksym_exists(scx_bpf_dsq_move_to_local___v2) ? \
- scx_bpf_dsq_move_to_local___v2((dsq_id), (enq_flags)) : \
+ (bpf_ksym_exists(scx_bpf_dsq_move_to_local___v2___compat) ? \
+ scx_bpf_dsq_move_to_local___v2___compat((dsq_id), (enq_flags)) : \
(bpf_ksym_exists(scx_bpf_dsq_move_to_local___v1) ? \
scx_bpf_dsq_move_to_local___v1((dsq_id)) : \
scx_bpf_consume___old((dsq_id))))
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sched_ext: Fix scx_bpf_dsq_move_to_local___v2 compat detection
2026-08-11 8:11 [PATCH] sched_ext: Fix scx_bpf_dsq_move_to_local___v2 compat detection Qiurong Fang
@ 2026-08-14 19:49 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2026-08-14 19:49 UTC (permalink / raw)
To: Qiurong Fang; +Cc: void, arighi, changwoo, emil, sched-ext, linux-kernel
Applied to sched_ext/for-7.2-fixes with the following changes:
- Fixes: tag updated to point at 860683763ebf ("sched_ext: Add enq_flags
to scx_bpf_dsq_move_to_local()"), the commit that's actually upstream.
e01a940b4813 doesn't exist in the published tree.
- Cc: stable@vger.kernel.org # v7.1+ added.
- The scx_qmap paragraph replaced with a generic impact statement as
needs_immed() doesn't exist in the applied branch.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-14 19:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-11 8:11 [PATCH] sched_ext: Fix scx_bpf_dsq_move_to_local___v2 compat detection Qiurong Fang
2026-08-14 19:49 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox