From: Cheng-Yang Chou Date: Wed, 13 May 2026 08:17:11 +0000 (+0800) Subject: tools/sched_ext: scx_qmap: Fix qa arena placement X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9017d335aab23c4514daed79c939af52a9aa7f6;p=thirdparty%2Fkernel%2Flinux.git tools/sched_ext: scx_qmap: Fix qa arena placement __arena is a pointer qualifier meaning "this pointer points to arena memory". When used on a global variable declaration, it expands to nothing in scx's build because __BPF_FEATURE_ADDR_SPACE_CAST is never defined, leaving qa as a plain global in BSS. bpftool then generates skel->bss->qa instead of the expected skel->arena->qa, causing: scx_qmap.c: error: 'struct scx_qmap' has no member named 'arena' __arena_global is the correct annotation for global variables that reside in the arena. When __BPF_FEATURE_ADDR_SPACE_CAST is not defined it expands to SEC(".addr_space.1"), placing qa in the arena ELF section. When __BPF_FEATURE_ADDR_SPACE_CAST is defined it expands to __attribute__((address_space(1))). In both cases bpftool generates the typed skel->arena accessor. Fixes: 60a59eaca71b ("sched_ext: scx_qmap: move globals and cpu_ctx into a BPF arena map") Signed-off-by: Cheng-Yang Chou Signed-off-by: Tejun Heo --- diff --git a/tools/sched_ext/scx_qmap.bpf.c b/tools/sched_ext/scx_qmap.bpf.c index bea43d2359083..7e77f22674eaa 100644 --- a/tools/sched_ext/scx_qmap.bpf.c +++ b/tools/sched_ext/scx_qmap.bpf.c @@ -89,7 +89,7 @@ struct { #endif } arena SEC(".maps"); -struct qmap_arena __arena qa; +struct qmap_arena __arena_global qa; /* * Global idle-cid tracking, maintained via update_idle / cpu_offline and