Re: [PATCH] selftests/bpf: Remove duplicate copies of the arena spinlock qnodes

Daniel Borkmann <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,dev.linux.lists.sched-ext,org.kernel.vger.bpf,org.kernel.vger.linux-kselftest
Message-ID <[email protected]>
On 8/3/26 2:18 AM, Changwoo Min wrote:
> bpf_arena_spin_lock.h defines its 64KB qnodes array in the header, so
> every translation unit including it emits a copy. __weak makes them all
> resolve to one instance, but bpftool gen object merges only the symbols
> and concatenates each input's .addr_space.1 bytes, leaving the surplus
> copies unreferenced in the linked object.
> 
> libarena links ten such units, so nine copies were dead weight (bytes):
> 
>    object                             before       after
>    -----------------------------------------------------
>    .addr_space.1 in libarena.bpf.o    676200       86376
>    libarena.skel.h                   2100123      892371
>    libarena_asan.skel.h              2641124     1466477
> 
> Declare qnodes in the header and let each program define it once:
> libarena in src/common.bpf.c, and the arena_spin_lock test beside the
> lock it guards.
> 
> Tested with test_progs -t arena_spin_lock and -t libarena.
> 
> Signed-off-by: Changwoo Min <[email protected]>
This doesn't apply cleanly, could you respin against latest bpf-next?

Thanks,
Daniel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.