Re: [PATCH] mm: vmscan: fix dirty folios throttling on cgroup v1 for MGLRU

From: Baolin Wang

Date: Fri Mar 27 2026 - 22:38:57 EST




On 3/27/26 11:30 PM, Andrew Morton wrote:
On Fri, 27 Mar 2026 18:21:08 +0800 Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx> wrote:

The balance_dirty_pages() won't do the dirty folios throttling on cgroupv1.
See commit 9badce000e2c ("cgroup, writeback: don't enable cgroup writeback
on traditional hierarchies").

Moreover, after commit 6b0dfabb3555 ("fs: Remove aops->writepage"), we no
longer attempt to write back filesystem folios through reclaim.

On large memory systems, the flusher may not be able to write back quickly
enough. Consequently, MGLRU will encounter many folios that are already
under writeback. Since we cannot reclaim these dirty folios, the system
may run out of memory and trigger the OOM killer.

Hence, for cgroup v1, let's throttle reclaim after waking up the flusher,
which is similar to commit 81a70c21d917 ("mm/cgroup/reclaim: fix dirty
pages throttling on cgroup v1"), to avoid unnecessary OOM.

The following test program can easily reproduce the OOM issue. With this patch
applied, the test passes successfully.

$mkdir /sys/fs/cgroup/memory/test
$echo 256M > /sys/fs/cgroup/memory/test/memory.limit_in_bytes
$echo $$ > /sys/fs/cgroup/memory/test/cgroup.procs
$dd if=/dev/zero of=/mnt/data.bin bs=1M count=800

Fixes: ac35a4902374 ("mm: multi-gen LRU: minimal implementation")

3+ years ago, I don't see a need to rush this into 7.0.

Agree.

But should we cc:stable?

I don't think it's necessary. The issue isn't that serious:)