Sched_ext development
 help / color / mirror / Atom feed
* [PATCH sched_ext/for-7.1-fixes] tools/sched_ext: scx_qmap: Fix qa arena placement
@ 2026-05-13  8:17 Cheng-Yang Chou
  2026-05-13 19:23 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Cheng-Yang Chou @ 2026-05-13  8:17 UTC (permalink / raw)
  To: sched-ext, Tejun Heo, David Vernet, Andrea Righi, Changwoo Min
  Cc: Ching-Chun Huang, Chia-Ping Tsai, Cheng-Yang Chou

__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: b986ae709b39 ("sched_ext: scx_qmap: move globals and cpu_ctx into a BPF arena map")
Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
---
 tools/sched_ext/scx_qmap.bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/sched_ext/scx_qmap.bpf.c b/tools/sched_ext/scx_qmap.bpf.c
index bea43d235908..7e77f22674ea 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
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH sched_ext/for-7.1-fixes] tools/sched_ext: scx_qmap: Fix qa arena placement
  2026-05-13  8:17 [PATCH sched_ext/for-7.1-fixes] tools/sched_ext: scx_qmap: Fix qa arena placement Cheng-Yang Chou
@ 2026-05-13 19:23 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2026-05-13 19:23 UTC (permalink / raw)
  To: Cheng-Yang Chou
  Cc: sched-ext, David Vernet, Andrea Righi, Changwoo Min,
	Ching-Chun Huang, Chia-Ping Tsai, Emil Tsalapatis, linux-kernel

Hello,

On Wed, May 13, 2026 at 04:17:11PM +0800, Cheng-Yang Chou wrote:
> tools/sched_ext: scx_qmap: Fix qa arena placement

Applied to sched_ext/for-7.2 with the Fixes: SHA replaced by
60a59eaca71b ("sched_ext: scx_qmap: move globals and cpu_ctx into a BPF
arena map"). The b986ae709b39 you referenced is a local-only commit on
one of my work branches; the corresponding public commit on for-7.2 is
60a59eaca71b. The arena conversion isn't on for-7.1-fixes, so the fix
lands on for-7.2 along with it.

Thanks.

--
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-13 19:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-13  8:17 [PATCH sched_ext/for-7.1-fixes] tools/sched_ext: scx_qmap: Fix qa arena placement Cheng-Yang Chou
2026-05-13 19:23 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox