[PATCH v2 0/3] memcg: decouple memcg and objcg stocks

From: Shakeel Butt
Date: Thu May 01 2025 - 20:18:14 EST


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.

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

Shakeel Butt (3):
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 | 159 +++++++++++++++++++++++++++++-------------------
1 file changed, 97 insertions(+), 62 deletions(-)

--
2.47.1