linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next v2 0/7] mm/mglru: remove memcg lru
@ 2025-12-24  7:30 Chen Ridong
  2025-12-24  7:30 ` [PATCH -next v2 1/7] mm/mglru: use mem_cgroup_iter for global reclaim Chen Ridong
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Chen Ridong @ 2025-12-24  7:30 UTC (permalink / raw)
  To: akpm, axelrasmussen, yuanchu, weixugc, david, lorenzo.stoakes,
	Liam.Howlett, vbabka, rppt, surenb, mhocko, corbet, hannes,
	roman.gushchin, shakeel.butt, muchun.song, zhengqi.arch, mkoutny
  Cc: linux-mm, linux-doc, linux-kernel, cgroups, lujialin4, chenridong

From: Chen Ridong <chenridong@huawei.com>

The memcg LRU was introduced to improve scalability in global reclaim,
but its implementation has grown complex and can cause performance
regressions when creating many memory cgroups [1].

This series implements mem_cgroup_iter with a reclaim cookie in
shrink_many() for global reclaim, following the pattern already used in
shrink_node_memcgs(), an approach suggested by Johannes [1]. The new
design maintains good fairness across cgroups by preserving iteration
state between reclaim passes.

Testing was performed using the original stress test from Yu Zhao [2] on a
1 TB, 4-node NUMA system. The results show:

    pgsteal:
                                        memcg LRU    memcg iter
    stddev(pgsteal) / mean(pgsteal)     106.03%       93.20%
    sum(pgsteal) / sum(requested)        98.10%       99.28%
    
    workingset_refault_anon:
                                        memcg LRU    memcg iter
    stddev(refault) / mean(refault)     193.97%      134.67%
    sum(refault)                       1,963,229    2,027,567

The new implementation shows clear fairness improvements, reducing the
standard deviation relative to the mean by 12.8 percentage points for
pgsteal and bringing the pgsteal ratio closer to 100%. Refault counts
increased by 3.2% (from 1,963,229 to 2,027,567).

To simplify review:
1. Patch 1 uses mem_cgroup_iter with reclaim cookie in shrink_many()
2. Patch 2 removes the now-unused memcg LRU code
3. Patches 3–7 combine shrink_many and shrink_node_memcgs
   (This reorganization is clearer after switching to mem_cgroup_iter)

[1] https://lore.kernel.org/r/20251126171513.GC135004@cmpxchg.org
[2] https://lore.kernel.org/r/20221222041905.2431096-7-yuzhao@google.com

---

Changes in v2:
1. Patch 1 now aligns more closely with shrink_node_memcgs
2. Patch 3 separates the flush_reclaim_state() changes into its own patch
3. Incorporated feedback/suggestions from Johannes and Shakeel.

Changes from RFC series:
1. Updated the test result data.
2. Added patches 3–5 to combine shrink_many and shrink_node_memcgs.

Chen Ridong (7):
  mm/mglru: use mem_cgroup_iter for global reclaim
  mm/mglru: remove memcg lru
  mm/mglru: make calls to flush_reclaim_state() similar for MGLRU and
    non-MGLRU
  mm/mglru: rename should_abort_scan to lru_gen_should_abort_scan
  mm/mglru: extend lru_gen_shrink_lruvec to support root reclaim
  mm/mglru: combine shrink_many into shrink_node_memcgs
  mm/mglru: remove memcg disable handling from lru_gen_shrink_node

 Documentation/mm/multigen_lru.rst |  30 ---
 include/linux/mmzone.h            |  89 ---------
 mm/memcontrol-v1.c                |   6 -
 mm/memcontrol.c                   |   4 -
 mm/mm_init.c                      |   1 -
 mm/vmscan.c                       | 313 +++---------------------------
 6 files changed, 31 insertions(+), 412 deletions(-)

-- 
2.34.1



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

end of thread, other threads:[~2025-12-28  2:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-24  7:30 [PATCH -next v2 0/7] mm/mglru: remove memcg lru Chen Ridong
2025-12-24  7:30 ` [PATCH -next v2 1/7] mm/mglru: use mem_cgroup_iter for global reclaim Chen Ridong
2025-12-24  7:30 ` [PATCH -next v2 2/7] mm/mglru: remove memcg lru Chen Ridong
2025-12-24  7:30 ` [PATCH -next v2 3/7] mm/mglru: make calls to flush_reclaim_state() similar for MGLRU and non-MGLRU Chen Ridong
2025-12-24  7:30 ` [PATCH -next v2 4/7] mm/mglru: rename should_abort_scan to lru_gen_should_abort_scan Chen Ridong
2025-12-24  7:30 ` [PATCH -next v2 5/7] mm/mglru: extend lru_gen_shrink_lruvec to support root reclaim Chen Ridong
2025-12-24  7:30 ` [PATCH -next v2 6/7] mm/mglru: combine shrink_many into shrink_node_memcgs Chen Ridong
2025-12-24  7:30 ` [PATCH -next v2 7/7] mm/mglru: remove memcg disable handling from lru_gen_shrink_node Chen Ridong
2025-12-28  2:02   ` kernel test robot
2025-12-27 17:49 ` [PATCH -next v2 0/7] mm/mglru: remove memcg lru Kairui Song

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