* + mm-vmscan-always-allow-writeback-during-memcg-reclaim.patch added to mm-new branch
@ 2025-12-14 23:49 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-12-14 23:49 UTC (permalink / raw)
To: mm-commits, songmuchun, shakeel.butt, roman.gushchin, mhocko,
hannes, kartikey406, akpm
The patch titled
Subject: mm: vmscan: always allow writeback during memcg reclaim
has been added to the -mm mm-new branch. Its filename is
mm-vmscan-always-allow-writeback-during-memcg-reclaim.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-vmscan-always-allow-writeback-during-memcg-reclaim.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews. Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Deepanshu Kartikey <kartikey406@gmail.com>
Subject: mm: vmscan: always allow writeback during memcg reclaim
Date: Sat, 13 Dec 2025 14:06:39 +0530
When laptop_mode is enabled, may_writepage is set to 0 in
try_to_free_mem_cgroup_pages(). This triggers a warning in MGLRU's
lru_gen_shrink_lruvec():
VM_WARN_ON_ONCE(!sc->may_writepage || !sc->may_unmap);
The warning occurs because MGLRU expects full reclaim capabilities to
function correctly. The call path is:
mem_cgroup_resize_max()
try_to_free_mem_cgroup_pages()
do_try_to_free_pages()
shrink_node()
shrink_lruvec()
lru_gen_shrink_lruvec() <-- WARNING
Unlike kswapd or direct reclaim where laptop_mode's disk-saving behavior
is a reasonable optimization, memcg limit enforcement is a hard
requirement - memory MUST be freed when a cgroup exceeds its limit. The
may_unmap field is already set unconditionally to 1 in this path,
acknowledging that memcg reclaim needs full capabilities.
Set may_writepage unconditionally to 1 for memcg reclaim to ensure MGLRU
works correctly and memory limits are properly enforced.
Link: https://lkml.kernel.org/r/20251213083639.364539-1-kartikey406@gmail.com
Fixes: bd74fdaea146 ("mm: multi-gen LRU: support page table walks")
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
Reported-by: syzbot+90fcab4d88cffed6d0d8@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=90fcab4d88cffed6d0d8
Cc: Michal Hocko <mhocko@suse.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/vmscan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mm/vmscan.c~mm-vmscan-always-allow-writeback-during-memcg-reclaim
+++ a/mm/vmscan.c
@@ -6671,7 +6671,7 @@ unsigned long try_to_free_mem_cgroup_pag
.reclaim_idx = MAX_NR_ZONES - 1,
.target_mem_cgroup = memcg,
.priority = DEF_PRIORITY,
- .may_writepage = !laptop_mode,
+ .may_writepage = 1,
.may_unmap = 1,
.may_swap = !!(reclaim_options & MEMCG_RECLAIM_MAY_SWAP),
.proactive = !!(reclaim_options & MEMCG_RECLAIM_PROACTIVE),
_
Patches currently in -mm which might be from kartikey406@gmail.com are
mm-vmscan-always-allow-writeback-during-memcg-reclaim.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-12-14 23:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-14 23:49 + mm-vmscan-always-allow-writeback-during-memcg-reclaim.patch added to mm-new branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.