Skip to content

selftests/bpf: libarena: compatibility fixups

Emil Tsalapatis bpf 2 versions 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 · linked by author and title

  1. v2 Latest4 patches 0 repliesApplied 4/4
  2. v14 patches 0 repliesSuperseded

Patches in v2 All 4 applied

#Subject and filesSizeRepliesApplied
1/4libarena: remove in-code licensestools/testing/selftests/bpf/libarena/benchs/bench_malloc.bpf.c tools/testing/selftests/bpf/libarena/src/asan.bpf.c tools/testing/selftests/bpf/libarena/src/buddy.bpf.c +1 more+2 -60 repliesApplied
2/4selftests/bpf: libarena: make allocator growth on alloc failure optionaltools/testing/selftests/bpf/libarena/include/libarena/buddy.h tools/testing/selftests/bpf/libarena/src/buddy.bpf.c+19 -20 repliesApplied
3/4selftests/bpf: libarena: add explicit buddy_grow() calltools/testing/selftests/bpf/libarena/include/libarena/buddy.h tools/testing/selftests/bpf/libarena/src/buddy.bpf.c+27 -00 repliesApplied
4/4selftests/bpf: libarena: Make zero variable type __u32 instead of u32tools/testing/selftests/bpf/libarena/include/libarena/common.h tools/testing/selftests/bpf/libarena/src/common.bpf.c+2 -20 repliesApplied

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/4] selftests/bpf: libarena: compatibility fixups

This patchset fixes several issues found while integrating with large BPF codebases.

Patch 1 fixes a mismatch between the in-code licenses for some files that do not actually correspond to the licenses at the top of the file. Remove the in-code license sections, since libarena is distributed only as source code anyway.

Patches 2-3 add an explicit allocator growth call. Some allocator users prefer to explicitly expand the arena instead of implicitly letting the allocator do so when required to satisfy an alloc. The change is non-functional for existing users.

Patch 4 changes the type of the volatile zero variable used for loop convergence to __u32. This is available from <linux/types.h>, while u32 needs to be typedef'ed in for userspace programs.

v1 -> v2 (https://lore.kernel.org/bpf/[email protected]/)
- Add a "Dual BSD/GPL" license section to the benchmark consumer so libarena-malloc and libarena-calloc remain loadable (Sashiko bot).
- Rename buddy_grow()'s size argument to nr_chunks and use a size_t loop index to make the chunk-count API explicit (Sashiko bot).

Emil Tsalapatis (4):
libarena: remove in-code licenses
selftests/bpf: libarena: make allocator growth on alloc failure
optional
selftests/bpf: libarena: add explicit buddy_grow() call selftests/bpf: libarena: Make zero variable type __u32 instead of u32

 .../bpf/libarena/benchs/bench_malloc.bpf.c    |  2 +
 .../bpf/libarena/include/libarena/buddy.h     |  2 +
 .../bpf/libarena/include/libarena/common.h    |  2 +-
 .../selftests/bpf/libarena/src/asan.bpf.c     |  2 -
 .../selftests/bpf/libarena/src/buddy.bpf.c    | 48 +++++++++++++++++--
 .../selftests/bpf/libarena/src/common.bpf.c   |  4 +-
 6 files changed, 50 insertions(+), 10 deletions(-)
Signature · 1 line
2.52.0