bpf: Add memory usage for arena and selftest
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
- v2 Latest4 patches 5 repliesApplied 4/4
- v13 patches 3 repliesSuperseded
Changes in v2 from the cover letter
- split the scratch_page -> arena refactor into a prep patch (no functional change)
- use WRITE_ONCE() for nr_pages to pair with the lockless reader
- reword the "run serially" commit message
- selftest: alloc prog returns 0 so the failure check is reached
Patches in v2 All 4 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | bpf: Pass arena instead of scratch_page to the pte callbackskernel/ | +8 | 1 reply | Applied |
| 2/4 | bpf: Add memory usage for arenakernel/ | +8 | 1 reply | Applied |
| 3/4 | selftests/bpf: Run arena tests seriallytools/ tools/ tools/ +5 more | +8 | 1 reply | Applied |
| 4/4 | selftests/bpf: Add tests for memory usage for arenatools/ tools/ | +162 | 2 replies | Applied |
Reviews trailers per patch
All 4 patches have a Reviewed-by or Acked-by.
| Patch | Emil Tsalapatis |
|---|---|
| 1/4 | R-b |
| 2/4 | R-b |
| 3/4 | R-b |
| 4/4 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH bpf-next v2 0/4] bpf: Add memory usage for arena and selftest
arena is the only map type whose map_mem_usage() still returns 0, so bpftool and fdinfo always show 0 memlock for it no matter how many pages it holds. This series adds the accounting, runs the arena selftests serially so they don't OOM a small CI VM, and adds a test for it.
v1 -> v2:
- split the scratch_page -> arena refactor into a prep patch (no functional change)
- use WRITE_ONCE() for nr_pages to pair with the lockless reader
- reword the "run serially" commit message
- selftest: alloc prog returns 0 so the failure check is reached
v1: https://lore.kernel.org/bpf/[email protected]/
Jiayuan Chen (4):
bpf: Pass arena instead of scratch_page to the pte callbacks
bpf: Add memory usage for arena
selftests/bpf: Run arena tests serially selftests/bpf: Add tests for memory usage for arena
kernel/bpf/arena.c | 27 ++-- .../selftests/bpf/prog_tests/arena_atomics.c | 2 +- .../bpf/prog_tests/arena_direct_value.c | 2 +- .../selftests/bpf/prog_tests/arena_htab.c | 2 +- .../selftests/bpf/prog_tests/arena_list.c | 2 +- .../bpf/prog_tests/arena_mem_usage.c | 122 ++++++++++++++++++ .../bpf/prog_tests/arena_spin_lock.c | 2 +- .../bpf/prog_tests/arena_strsearch.c | 2 +- .../selftests/bpf/prog_tests/libarena.c | 2 +- .../selftests/bpf/prog_tests/libarena_asan.c | 2 +- .../selftests/bpf/progs/arena_mem_usage.c | 40 ++++++ 11 files changed, 186 insertions(+), 19 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/arena_mem_usage.c create mode 100644 tools/testing/selftests/bpf/progs/arena_mem_usage.c
Signature · 1 line
2.43.0