Commit 4376807
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: e4dde56 ("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>1 parent 8aa4206 commit 4376807
2 files changed
Lines changed: 20 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
519 | 519 | | |
520 | 520 | | |
521 | 521 | | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4598 | 4598 | | |
4599 | 4599 | | |
4600 | 4600 | | |
4601 | | - | |
| 4601 | + | |
| 4602 | + | |
| 4603 | + | |
| 4604 | + | |
| 4605 | + | |
| 4606 | + | |
4602 | 4607 | | |
4603 | 4608 | | |
4604 | 4609 | | |
| |||
4719 | 4724 | | |
4720 | 4725 | | |
4721 | 4726 | | |
4722 | | - | |
4723 | 4727 | | |
4724 | 4728 | | |
4725 | 4729 | | |
4726 | | - | |
4727 | | - | |
4728 | | - | |
4729 | | - | |
4730 | 4730 | | |
4731 | 4731 | | |
4732 | 4732 | | |
4733 | 4733 | | |
4734 | 4734 | | |
4735 | 4735 | | |
4736 | 4736 | | |
4737 | | - | |
| 4737 | + | |
4738 | 4738 | | |
4739 | 4739 | | |
4740 | 4740 | | |
| |||
4750 | 4750 | | |
4751 | 4751 | | |
4752 | 4752 | | |
4753 | | - | |
| 4753 | + | |
| 4754 | + | |
| 4755 | + | |
| 4756 | + | |
| 4757 | + | |
| 4758 | + | |
| 4759 | + | |
| 4760 | + | |
| 4761 | + | |
4754 | 4762 | | |
4755 | 4763 | | |
4756 | 4764 | | |
| |||
0 commit comments