Skip to content

RFC mm: memcg accounting of percpu memory

Roman Gushchin linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5percpu: return number of released bytes from pcpu_free_area()mm/percpu.c+10 -30 replies
2/5mm: memcg/percpu: account percpu memory to memory cgroupsmm/percpu-internal.h mm/percpu-km.c mm/percpu-stats.c +2 more+237 -412 replies
3/5mm: memcg/percpu: per-memcg percpu memory statisticsDocumentation/admin-guide/cgroup-v2.rst include/linux/memcontrol.h mm/memcontrol.c +1 more+25 -10 replies
4/5mm: memcg: charge memcg percpu memory to the parent cgroupmm/memcontrol.c+10 -40 replies
5/5kselftests: cgroup: add perpcu memory accounting testtools/testing/selftests/cgroup/test_kmem.c+59 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH RFC 0/5] mm: memcg accounting of percpu memory

This patchset adds percpu memory accounting to memory cgroups. It's based on the rework of the slab controller and reuses concepts and features introduced for the per-object slab accounting.

Percpu allocations by their nature are scattered over multiple pages, so they can't be tracked on the per-page basis. So the per-object tracking introduced by the new slab controller is reused.

The patchset implements charging of percpu allocations, adds memcg-level statistics, enables accounting for memcg internals perpcu allocations and provides some basic tests.

It's based on top of the current version of the new slab controller patchset. The following patches are actually required by this series:
mm: memcg: factor out memcg- and lruvec-level changes out of __mod_lruvec_state()
mm: memcg: prepare for byte-sized vmstat items
mm: memcg: convert vmstat slab counters to bytes
mm: slub: implement SLUB version of obj_to_index()
mm: memcontrol: decouple reference counting from page accounting
mm: memcg/slab: obj_cgroup API

The whole series can be found here:
https://github.com/rgushchin/linux/pull/new/percpu_acc.RFC

Roman Gushchin (5):
percpu: return number of released bytes from pcpu_free_area()
mm: memcg/percpu: account percpu memory to memory cgroups
mm: memcg/percpu: per-memcg percpu memory statistics
mm: memcg: charge memcg percpu memory to the parent cgroup
kselftests: cgroup: add perpcu memory accounting test

 Documentation/admin-guide/cgroup-v2.rst    |   4 +
 include/linux/memcontrol.h                 |   8 +
 mm/memcontrol.c                            |  18 +-
 mm/percpu-internal.h                       |  49 ++++-
 mm/percpu-km.c                             |   5 +-
 mm/percpu-stats.c                          |  36 ++--
 mm/percpu-vm.c                             |   5 +-
 mm/percpu.c                                | 206 ++++++++++++++++++---
 tools/testing/selftests/cgroup/test_kmem.c |  59 ++++++
 9 files changed, 341 insertions(+), 49 deletions(-)
Signature · 1 line
2.25.4