BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v5 0/2] memcg accounting for BPF arena
@ 2026-01-02 20:02 Puranjay Mohan
  2026-01-02 20:02 ` [PATCH bpf-next v5 1/2] bpf: syscall: Introduce memcg enter/exit helpers Puranjay Mohan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Puranjay Mohan @ 2026-01-02 20:02 UTC (permalink / raw)
  To: bpf
  Cc: Puranjay Mohan, Puranjay Mohan, Alexei Starovoitov,
	Andrii Nakryiko, Daniel Borkmann, Martin KaFai Lau,
	Eduard Zingerman, Kumar Kartikeya Dwivedi, kernel-team

v4: https://lore.kernel.org/all/20260102181333.3033679-1-puranjay@kernel.org/
Changes in v4->v5:
- Remove unused variables from bpf_map_alloc_pages() (CI)

v3: https://lore.kernel.org/all/20260102151852.570285-1-puranjay@kernel.org/
Changes in v3->v4:
- Do memcg set/recover in arena_reserve_pages() rather than
  bpf_arena_reserve_pages() for symmetry with other kfuncs (Alexei)

v2: https://lore.kernel.org/all/20251231141434.3416822-1-puranjay@kernel.org/
Changes in v2->v3:
- Remove memcg accounting from bpf_map_alloc_pages() as the caller does
  it already. (Alexei)
- Do memcg set/recover in arena_alloc/free_pages() rather than
  bpf_arena_alloc/free_pages(), it reduces copy pasting in
  sleepable/non_sleepable functions.

v1: https://lore.kernel.org/all/20251230153006.1347742-1-puranjay@kernel.org/
Changes in v1->v2:
- Return both pointers through arguments from bpf_map_memcg_enter and
  make it return void. (Alexei)
- Add memcg accounting in arena_free_worker (AI)

This set adds memcg accounting logic into arena kfuncs and other places
that do allocations in arena.c.

Puranjay Mohan (2):
  bpf: syscall: Introduce memcg enter/exit helpers
  bpf: arena: Reintroduce memcg accounting

 include/linux/bpf.h     | 15 ++++++++++++
 kernel/bpf/arena.c      | 29 +++++++++++++++++++---
 kernel/bpf/range_tree.c |  5 ++--
 kernel/bpf/syscall.c    | 53 +++++++++++++++++++----------------------
 4 files changed, 68 insertions(+), 34 deletions(-)


base-commit: c286e7e9d1f1f3d90ad11c37e896f582b02d19c4
-- 
2.47.3


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

end of thread, other threads:[~2026-01-02 22:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-02 20:02 [PATCH bpf-next v5 0/2] memcg accounting for BPF arena Puranjay Mohan
2026-01-02 20:02 ` [PATCH bpf-next v5 1/2] bpf: syscall: Introduce memcg enter/exit helpers Puranjay Mohan
2026-01-02 20:02 ` [PATCH bpf-next v5 2/2] bpf: arena: Reintroduce memcg accounting Puranjay Mohan
2026-01-02 22:40 ` [PATCH bpf-next v5 0/2] memcg accounting for BPF arena patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox