All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/4] bpf: Add memory usage for arena and selftest
@ 2026-07-17 11:37 Jiayuan Chen
  2026-07-17 11:37 ` [PATCH bpf-next v2 1/4] bpf: Pass arena instead of scratch_page to the pte callbacks Jiayuan Chen
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jiayuan Chen @ 2026-07-17 11:37 UTC (permalink / raw)
  To: bpf
  Cc: Jiayuan Chen, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Eduard Zingerman, Kumar Kartikeya Dwivedi,
	Martin KaFai Lau, Song Liu, Yonghong Song, Jiri Olsa,
	Emil Tsalapatis, Shuah Khan, Woojin Ji, Puranjay Mohan,
	Saket Kumar Bhaskar, Ihor Solodrai, linux-kernel, linux-kselftest

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/20260716142746.8794-1-jiayuan.chen@linux.dev/

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

-- 
2.43.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-07-17 13:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-17 11:37 [PATCH bpf-next v2 0/4] bpf: Add memory usage for arena and selftest Jiayuan Chen
2026-07-17 11:37 ` [PATCH bpf-next v2 1/4] bpf: Pass arena instead of scratch_page to the pte callbacks Jiayuan Chen
2026-07-17 11:37 ` [PATCH bpf-next v2 2/4] bpf: Add memory usage for arena Jiayuan Chen
2026-07-17 11:37 ` [PATCH bpf-next v2 3/4] selftests/bpf: Run arena tests serially Jiayuan Chen
2026-07-17 11:37 ` [PATCH bpf-next v2 4/4] selftests/bpf: Add tests for memory usage for arena Jiayuan Chen
2026-07-17 11:53   ` sashiko-bot
2026-07-17 13:18     ` Jiayuan Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.