Skip to content

memcg: decouple memcg and objcg stocks

Shakeel Butt bpf cgroups linux-mm lkml netdev 3 versions – Applied

Status from this message: [merged mm-stable] memcg-no-irq-disable-for-memcg-stock-lock.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 2 repliesApplied 4/4
  2. v23 patches 8 repliesSuperseded
  3. v14 patches 7 repliesSuperseded

Changes in v3 from the cover letter

- Ran and included network intensive benchmarking results
- Brought back the simplify patch dropped in v2 after perf experiment.

Patches in v3 All 4 applied

#Subject and filesSizeRepliesApplied
1/4memcg: simplify consume_stockmm/memcontrol.c+7 -131 replyApplied
2/4memcg: separate local_trylock for memcg and objmm/memcontrol.c+26 -231 replyApplied
3/4memcg: completely decouple memcg and obj stocksmm/memcontrol.c+92 -570 repliesApplied
4/4memcg: no irq disable for memcg stock lockmm/memcontrol.c+6 -90 repliesApplied

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchVlastimil Babka
1/4R-b
2/4R-b
3/4A-b
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/4] memcg: decouple memcg and objcg stocks

The per-cpu memcg charge cache and objcg charge cache are coupled in a single struct memcg_stock_pcp and a single local lock is used to protect both of the caches. This makes memcg charging and objcg charging nmi safe challenging. Decoupling memcg and objcg stocks would allow us to make them nmi safe and even work without disabling irqs independently. This series completely decouples memcg and objcg stocks.

To evaluate the impact of this series with and without PREEMPT_RT config, we ran varying number of netperf clients in different cgroups on a 72 CPU machine.

 $ netserver -6
 $ netperf -6 -H ::1 -l 60 -t TCP_SENDFILE -- -m 10K

PREEMPT_RT config:
------------------

number of clients | Without series | With series
  6               | 38559.1 Mbps   | 38652.6 Mbps
  12              | 37388.8 Mbps   | 37560.1 Mbps
  18              | 30707.5 Mbps   | 31378.3 Mbps
  24              | 25908.4 Mbps   | 26423.9 Mbps
  30              | 22347.7 Mbps   | 22326.5 Mbps
  36              | 20235.1 Mbps   | 20165.0 Mbps

!PREEMPT_RT config:
-------------------

number of clients | Without series | With series
  6               | 50235.7 Mbps   | 51415.4 Mbps
  12              | 49336.5 Mbps   | 49901.4 Mbps
  18              | 46306.8 Mbps   | 46482.7 Mbps
  24              | 38145.7 Mbps   | 38729.4 Mbps
  30              | 30347.6 Mbps   | 31698.2 Mbps
  36              | 26976.6 Mbps   | 27364.4 Mbps

No performance regression was observed.

Changes since v2:
- Ran and included network intensive benchmarking results
- Brought back the simplify patch dropped in v2 after perf experiment.

Changes since v1:
- Drop first patch as requested by Alexei.
- Remove preempt_disable() usage as suggested by Vlastimil.

Shakeel Butt (4):
memcg: simplify consume_stock
memcg: separate local_trylock for memcg and obj
memcg: completely decouple memcg and obj stocks
memcg: no irq disable for memcg stock lock

 mm/memcontrol.c | 175 ++++++++++++++++++++++++++++--------------------
 1 file changed, 102 insertions(+), 73 deletions(-)
Signature · 1 line
2.47.1