[PATCH 0/6] selftests/bpf: Fixes and improvements for libarena
Emil Tsalapatis <[email protected]>
| Newsgroups | org.kernel.vger.bpf |
|---|---|
| Message-ID | <[email protected]> |
This patchset addresses issues and feature gaps in libarena's existing code, and optimizes some common code paths. Patch 1 fixes up an inconsistency in the SPDX tags. Patch 2 incorporates a followup patch for bitmaps that inlines the nonatomic versions of the set/clear/test operations. Patch 3 makes it safe to use the arena allocator under IRQ reentrancy. Ensuring the allocator is correct under NMIs will be addressed in a subsequent patch because it is a larger change. Patches 4 to 6 add a calloc() interface for the allocator, along with a benchmark that is useful for quickly finding obvious regressions during development. Signed-off-by: Emil Tsalapatis <[email protected]> Emil Tsalapatis (6): selftests/bpf: libarena: Normalize SPDX headers across files selftests/bpf: libarena: Inline nonatomic bitmap operations selftests/bpf: libarena: Disable IRQs during allocation selftests/bpf: libarena: Add calloc() call selftests/bpf: libarena: Add a benchmark for malloc()/calloc() selftests/bpf: libarena: Optimize and make public arena_memset tools/testing/selftests/bpf/Makefile | 18 +- tools/testing/selftests/bpf/bench.c | 6 + .../selftests/bpf/benchs/bench_libarena.c | 210 ++++++++++++++++++ .../bpf/benchs/run_bench_libarena.sh | 31 +++ tools/testing/selftests/bpf/libarena/Makefile | 31 ++- .../bpf/libarena/benchs/bench_malloc.bpf.c | 51 +++++ .../libarena/include/bpf_arena_spin_lock.h | 2 +- .../bpf/libarena/include/bpf_atomic.h | 2 +- .../bpf/libarena/include/bpf_may_goto.h | 1 + .../bpf/libarena/include/libarena/bitmap.h | 30 ++- .../bpf/libarena/include/libarena/common.h | 71 ++++++ .../bpf/libarena/selftests/test_bitmap.bpf.c | 3 + .../selftests/bpf/libarena/src/asan.bpf.c | 21 +- .../selftests/bpf/libarena/src/bitmap.bpf.c | 18 -- .../selftests/bpf/libarena/src/buddy.bpf.c | 44 ++-- .../selftests/bpf/libarena/src/common.bpf.c | 27 ++- 16 files changed, 489 insertions(+), 77 deletions(-) create mode 100644 tools/testing/selftests/bpf/benchs/bench_libarena.c create mode 100755 tools/testing/selftests/bpf/benchs/run_bench_libarena.sh create mode 100644 tools/testing/selftests/bpf/libarena/benchs/bench_malloc.bpf.c -- 2.54.0