linux/mm
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: e4dde56cd2 ("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
..
damon mm/damon/core: make damon_start() waits until kdamond_fn() starts 2023-12-12 17:20:17 -08:00
kasan Many singleton patches against the MM code. The patch series which are 2023-11-02 19:38:47 -10:00
kfence
kmsan mm: kmsan: panic on failure to allocate early boot metadata 2023-10-25 16:47:10 -07:00
backing-dev.c
balloon_compaction.c
bootmem_info.c bootmem: use kmemleak_free_part_phys in put_page_bootmem 2023-10-25 16:47:13 -07:00
cma.c
cma.h
cma_debug.c
cma_sysfs.c
compaction.c
debug.c
debug_page_alloc.c
debug_page_ref.c
debug_vm_pgtable.c mm: fix multiple typos in multiple files 2023-10-25 16:47:14 -07:00
dmapool.c
dmapool_test.c
early_ioremap.c
fadvise.c
fail_page_alloc.c
failslab.c
filemap.c mm: fix oops when filemap_map_pmd() without prealloc_pte 2023-12-06 16:12:45 -08:00
folio-compat.c
gup.c
gup_test.c
gup_test.h
highmem.c
hmm.c
huge_memory.c mm: fix for negative counter: nr_file_hugepages 2023-11-15 15:30:09 -08:00
hugetlb.c hugetlb: fix null-ptr-deref in hugetlb_vma_lock_write 2023-12-06 16:12:43 -08:00
hugetlb_cgroup.c mm, hugetlb: remove HUGETLB_CGROUP_MIN_ORDER 2023-10-18 14:34:17 -07:00
hugetlb_vmemmap.c hugetlb_vmemmap: use folio argument for hugetlb_vmemmap_* functions 2023-10-25 16:47:08 -07:00
hugetlb_vmemmap.h mm: hugetlb_vmemmap: fix reference to nonexistent file 2023-10-25 16:47:14 -07:00
hwpoison-inject.c
init-mm.c
internal.h mm: add page_rmappable_folio() wrapper 2023-10-25 16:47:16 -07:00
interval_tree.c
io-mapping.c
ioremap.c
Kconfig mm/Kconfig: make userfaultfd a menuconfig 2023-12-06 16:12:47 -08:00
Kconfig.debug
khugepaged.c As usual, lots of singleton and doubleton patches all over the tree and 2023-11-02 20:53:31 -10:00
kmemleak.c mm/kmemleak: move set_track_prepare() outside raw_spinlocks 2023-12-06 16:12:44 -08:00
ksm.c mm: more ptep_get() conversion 2023-11-15 15:30:09 -08:00
list_lru.c
maccess.c
madvise.c mm/madvise: add cond_resched() in madvise_cold_or_pageout_pte_range() 2023-12-06 16:12:50 -08:00
Makefile
mapping_dirty_helpers.c
memblock.c memblock: report failures when memblock_can_resize is not set 2023-11-08 09:40:13 -08:00
memcontrol.c mm: kmem: properly initialize local objcg variable in current_obj_cgroup() 2023-12-06 16:12:44 -08:00
memfd.c
memory-failure.c
memory-tiers.c
memory.c mm/memory.c:zap_pte_range() print bad swap entry 2023-12-06 16:12:43 -08:00
memory_hotplug.c mm/memory_hotplug: fix error handling in add_memory_resource() 2023-12-06 16:12:46 -08:00
mempolicy.c Many singleton patches against the MM code. The patch series which are 2023-11-02 19:38:47 -10:00
mempool.c
memremap.c
memtest.c
migrate.c mm: migrate: record the mlocked page status to remove unnecessary lru drain 2023-10-25 16:47:14 -07:00
migrate_device.c
mincore.c
mlock.c mm: mlock: avoid folio_within_range() on KSM pages 2023-10-25 16:47:14 -07:00
mm_init.c
mm_slot.h
mmap.c Many singleton patches against the MM code. The patch series which are 2023-11-02 19:38:47 -10:00
mmap_lock.c
mmu_gather.c
mmu_notifier.c
mmzone.c mm: remove page_cpupid_xchg_last() 2023-10-25 16:47:13 -07:00
mprotect.c mm: mprotect: use a folio in change_pte_range() 2023-10-25 16:47:12 -07:00
mremap.c mm: abstract VMA merge and extend into vma_merge_extend() helper 2023-10-18 14:34:18 -07:00
msync.c
nommu.c Many singleton patches against the MM code. The patch series which are 2023-11-02 19:38:47 -10:00
oom_kill.c mm/oom_killer: simplify OOM killer info dump helper 2023-10-25 16:47:10 -07:00
page-writeback.c filemap: add a per-mapping stable writes flag 2023-11-20 15:05:18 +01:00
page_alloc.c mm: add page_rmappable_folio() wrapper 2023-10-25 16:47:16 -07:00
page_counter.c
page_ext.c
page_idle.c
page_io.c
page_isolation.c
page_owner.c mm/page_owner: remove free_ts from page_owner output 2023-10-18 14:34:19 -07:00
page_poison.c
page_reporting.c
page_reporting.h
page_table_check.c
page_vma_mapped.c
pagewalk.c
percpu-internal.h
percpu-km.c
percpu-stats.c
percpu-vm.c
percpu.c Many singleton patches against the MM code. The patch series which are 2023-11-02 19:38:47 -10:00
pgalloc-track.h
pgtable-generic.c
process_vm_access.c
ptdump.c
readahead.c vfs: fix readahead(2) on block devices 2023-10-19 11:02:49 +02:00
rmap.c
rodata_test.c
secretmem.c
shmem.c mm/shmem: fix race in shmem_undo_range w/THP 2023-12-12 17:20:19 -08:00
shmem_quota.c
show_mem.c
shrinker.c
shrinker_debug.c
shuffle.c
shuffle.h
slab.c
slab.h mm: kmem: scoped objcg protection 2023-10-25 16:47:11 -07:00
slab_common.c RCU pull request for v6.7 2023-10-30 18:01:41 -10:00
slub.c
sparse-vmemmap.c
sparse.c
swap.c
swap.h mempolicy: alloc_pages_mpol() for NUMA policy without vma 2023-10-25 16:47:16 -07:00
swap_cgroup.c
swap_slots.c
swap_state.c mempolicy: alloc_pages_mpol() for NUMA policy without vma 2023-10-25 16:47:16 -07:00
swapfile.c mm/swap: Convert to use bdev_open_by_dev() 2023-10-28 13:29:19 +02:00
truncate.c
usercopy.c
userfaultfd.c mm: more ptep_get() conversion 2023-11-15 15:30:09 -08:00
util.c parisc: fix mmap_base calculation when stack grows upwards 2023-11-15 15:30:09 -08:00
vmalloc.c mm/vmalloc: fix the unchecked dereference warning in vread_iter() 2023-11-01 12:38:35 -07:00
vmpressure.c
vmscan.c mm/mglru: reclaim offlined memcgs harder 2023-12-12 17:20:20 -08:00
vmstat.c mm: tune PCP high automatically 2023-10-25 16:47:10 -07:00
workingset.c mm/mglru: fix underprotected page cache 2023-12-12 17:20:19 -08:00
z3fold.c
zbud.c
zpool.c
zsmalloc.c
zswap.c zswap: export compression failure stats 2023-11-01 12:38:35 -07:00