Skip to content

selftests/bpf: Fixes and improvements for libarena

Emil Tsalapatis bpf sashiko-reviews 1 version Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 1 replyApplied 6/6

Patches in v1 All 6 applied

#Subject and filesSizeRepliesApplied
1/6selftests/bpf: libarena: Normalize SPDX headers across filestools/testing/selftests/bpf/libarena/include/bpf_arena_spin_lock.h tools/testing/selftests/bpf/libarena/include/bpf_atomic.h tools/testing/selftests/bpf/libarena/include/bpf_may_goto.h +2 more+7 -20 repliesApplied
2/6selftests/bpf: libarena: Inline nonatomic bitmap operationstools/testing/selftests/bpf/libarena/include/libarena/bitmap.h tools/testing/selftests/bpf/libarena/src/bitmap.bpf.c+26 -210 repliesApplied
3/6selftests/bpf: libarena: Disable IRQs during allocationtools/testing/selftests/bpf/libarena/src/buddy.bpf.c+22 -221 replyApplied
4/6selftests/bpf: libarena: Add calloc() calltools/testing/selftests/bpf/libarena/include/libarena/common.h tools/testing/selftests/bpf/libarena/src/asan.bpf.c tools/testing/selftests/bpf/libarena/src/common.bpf.c+46 -200 repliesApplied
5/6selftests/bpf: libarena: Add a benchmark for malloc()/calloc()tools/testing/selftests/bpf/Makefile tools/testing/selftests/bpf/bench.c tools/testing/selftests/bpf/benchs/bench_libarena.c +3 more+334 -120 repliesApplied
6/6selftests/bpf: libarena: Optimize and make public arena_memsettools/testing/selftests/bpf/libarena/Makefile tools/testing/selftests/bpf/libarena/include/libarena/common.h+56 -20 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] selftests/bpf: Fixes and improvements for libarena

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.

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
Signature · 1 line
2.54.0