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

Song Liu
2026-04-10T23:07:09Z

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.

Thanks,
Song