Yu Zhao 4376807bf2 mm/mglru: reclaim offlined memcgs harder
In the effort to reduce zombie memcgs [1], it was discovered that the
memcg LRU doesn't apply enough pressure on offlined memcgs.  Specifically,
instead of rotating them to the tail of the current generation
(MEMCG_LRU_TAIL) for a second attempt, it moves them to the next
generation (MEMCG_LRU_YOUNG) after the first attempt.

Not applying enough pressure on offlined memcgs can cause them to build
up, and this can be particularly harmful to memory-constrained systems.

On Pixel 8 Pro, launching apps for 50 cycles:
                 Before  After  Change
  Zombie memcgs  45      35     -22%

[1] https://lore.kernel.org/CABdmKX2M6koq4Q0Cmp_-=wbP0Qa190HdEGGaHfxNS05gAkUtPA@mail.gmail.com/

Link: https://lkml.kernel.org/r/20231208061407.2125867-4-yuzhao@google.com
Fixes: e4dde56cd208 ("mm: multi-gen LRU: per-node lru_gen_folio lists")
Signed-off-by: Yu Zhao <yuzhao@google.com>
Reported-by: T.J. Mercier <tjmercier@google.com>
Tested-by: T.J. Mercier <tjmercier@google.com>
Cc: Charan Teja Kalla <quic_charante@quicinc.com>
Cc: Hillf Danton <hdanton@sina.com>
Cc: Jaroslav Pulchart <jaroslav.pulchart@gooddata.com>
Cc: Kairui Song <ryncsn@gmail.com>
Cc: Kalesh Singh <kaleshsingh@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-12 17:20:20 -08:00
..
2023-09-08 12:16:52 -07:00
2023-06-09 16:25:17 -07:00
2023-07-24 18:04:30 -04:00
2023-06-19 16:19:25 -07:00
2023-11-15 15:30:09 -08:00
2023-04-12 17:36:23 -07:00
2023-08-31 12:20:12 -07:00
2022-10-03 14:02:43 -07:00
2023-10-25 16:47:13 -07:00
2021-05-07 00:26:35 -07:00
2023-10-04 10:32:19 -07:00
2023-10-30 18:01:41 -10:00
2023-07-18 10:07:47 +02:00
2023-10-25 16:47:11 -07:00
2023-06-23 16:59:30 -07:00
2023-04-12 17:36:23 -07:00
2023-11-15 15:30:09 -08:00
2023-10-25 16:47:10 -07:00