Skip to contentSkip to conversation

BPF libarena Development and

LSF/MM/BPF TOPIC Emil Tsalapatis 2 participants 2 messages Feb 3 – Mar 1 BPF

lore
Share & tools
lore

Emil Tsalapatis

author reviewer
#0 lore raw

Hello everyone,

I'd like to propose a session on the BPF libarena library under
development[1]. The details on how this library should be developed, managed, and provided to users are still open. The session would let us discuss those topics, along with sharing an overview of libarena itself.

libarena is a collection of arena-based code that will live in tools/testing/selftests/bpf/libarena and will provide a runtime for arena-based programs. The library currently includes memory allocators and an ASAN runtime for BPF arena memory, and will be expanded with arena-based implementations of data structures for development like B-trees, RB-trees, and heaps. The end result will look similar to the BPF arena library used by sched_ext[2]. Users will statically link the arena library into their code at compile time.

Possible issues for discussion:
- What kind of code/functionality are we interested in hosting in the library?
- How should the library be provided to users? (e.g. new repo in the libbpf org)
- BPF core features/adjustments for libarena development
- ASAN status, feedback and possible followups
- General usability feedback

[1] https://lore.kernel.org/bpf/[email protected]
[2] https://github.com/sched-ext/scx/tree/main/lib

#1 lore raw
Quoted 8 lines · Emil Tsalapatis

Hello everyone,

I'd like to propose a session on the BPF libarena library under
development[1]. The details on how this library should be developed, managed, and provided to users are still open. The session would let us discuss those topics, along with sharing an overview of libarena itself.

Quoted 9 lines

libarena is a collection of arena-based code that will live in tools/testing/selftests/bpf/libarena and will provide a runtime for arena-based programs. The library currently includes memory allocators and an ASAN runtime for BPF arena memory, and will be expanded with arena-based implementations of data structures for development like B-trees, RB-trees, and heaps. The end result will look similar to the BPF arena library used by sched_ext[2]. Users will statically link the arena library into their code at compile time.

Interesting, I have prototyped similar concepts in KernelScript [1], the biggest difference is that they are built into the language [2], like how Python handles data structures naturally.

1. https://github.com/multikernel/kernelscript
2. https://github.com/multikernel/kernelscript/tree/linked_list

Hope this helps.

Regards,
Cong Wang