Skip to content

memcg accounting for BPF arena

Puranjay Mohan bpf 5 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. v5 Latest2 patches 0 repliesApplied 2/2
  2. v42 patches 2 repliesSuperseded
  3. v32 patches 2 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches2 repliesSuperseded
v12 patches2 repliesSuperseded

Changes in v5 from the cover letter

- Remove unused variables from bpf_map_alloc_pages() (CI)

Patches in v5 All 2 applied

#Subject and filesSizeRepliesApplied
1/2bpf: syscall: Introduce memcg enter/exit helpersinclude/linux/bpf.h kernel/bpf/syscall.c+41 -280 repliesApplied
2/2bpf: arena: Reintroduce memcg accountingkernel/bpf/arena.c kernel/bpf/range_tree.c kernel/bpf/syscall.c+29 -80 repliesApplied

Reviews trailers per patch

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

Read the v5 thread

Cover letter [PATCH bpf-next v5 0/2] memcg accounting for BPF arena

v4: https://lore.kernel.org/all/[email protected]/
Changes in v4->v5:
- Remove unused variables from bpf_map_alloc_pages() (CI)

v3: https://lore.kernel.org/all/[email protected]/
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/[email protected]/
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/[email protected]/
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

Signature · 1 line
2.47.3