Re: [PATCH bpf-next v5 5/9] selftests/bpf: Add basic libarena scaffolding

Emil Tsalapatis
2026-04-10T23:58:27Z

On Fri Apr 10, 2026 at 7:06 PM EDT, Song Liu wrote:
> On Fri, Apr 10, 2026 at 3:50 PM Alexei Starovoitov
> <alexei.starovoitov@gmail.com> wrote:
> [...]
>> >
>> > There is also tools/sched_ext/include/scx/bpf_arena_common.h, which
>>
>> imo tools/sched_ext are bitrotting. I wouldn't be surprised
>> if they're removed. It's not really a library or a tool.
>
> Hmm.. In this case, we can probably ignore tools/sched_ext.
> I guess we can also ignore selftests/sched_ext? It is not getting
> a lot of active development either.
>
>> > is similar to bpf_arena_common.h in selftests/bpf. We can have sched_ext
>> > include this version of bpf_arena_common.h. However, it seems weird to
>> > have sched_ext code include a header in selftests/bpf. Therefore, I think
>> > it makes more sense to move libarena to tools/lib/. WDYT?
>>
>> I wouldn't. In general tools/lib/ is not a place for generic libraries.
>> libbpf is there because it's needed to build the kernel.
>> libarena is in selftest/bpf, because it's needed for selftests.
>> The kernel itself doesn't need it.
>> I would remove some of the libs from tools/lib/.
>
> Assuming both tools/sched_ext and selftest/sched_ext are bitrotting,
> selftests/bpf is likely the only user of libarena in the longer term.
> In this case, I agree it makes sense to keep libarena inside selftests/bpf.
>

The selftest/sched_ext selftests are being actively tested on the CI,
but for libarena specifically they don't use arenas.

I think keeping stale BPF headers in tools/sched_ext is not an issue -
in fact we can remove the header from there right now. The only user
of bpf_arena_common.h in tools/sched_ext is scx_sdt.c and is mostly
there to demonstrate how to use arenas in the first place. Most of the
contents of the header are for compatibility with older Clang and pahole
versions, but we explicitly don't support those and can remove them.
The scheduler is also not actively being expanded either, so we don't
need to worry about importing new features from selftests/bpf.

> Thanks,
> Song