Re: [PATCH v6 0/2] mm/vmscan: fix NR_ISOLATED accounting and throttle MGLRU eviction
From: Andrew Morton
Date: Wed Oct 14 2026 - 19:09:55 EST
On Wed, 14 Oct 2026 17:00:22 +0800 Hui Zhu <hui.zhu@xxxxxxxxx> wrote:
> The legacy reclaim path has two mechanisms around isolated folios that
> MGLRU lacks:
>
> 1. NR_ISOLATED_ANON/FILE counters are updated when folios are isolated
> from the inactive lists. Compaction's too_many_isolated() relies on
> them to decide when to back off. The MGLRU reclaim path never
> updates them, so compaction cannot see MGLRU's in-flight isolation.
>
> 2. shrink_inactive_list() throttles direct reclaim via
> too_many_isolated() when isolated folios pile up. MGLRU's
> evict_folios() isolates folios without any such check, so many
> concurrent reclaimers can over-isolate the same (oldest) generation,
> leading to unnecessary swapping, thrashing and premature memcg OOM.
>
> Patch 1 fixes the counter accounting in the MGLRU isolation path.
> Patch 2 adds a per-lruvec throttle, mirroring the legacy behavior but
> adapted to MGLRU's per-lruvec contention and its dynamic type
> selection/fallback.
Thanks. Questions for yourself and maintainers:
[1/2] is nice and simple and reviewed. How about I queue this for
second week of the upcoming merge window?
[2/2] is much more code, isn't reviewed and has a Sashiko whine[*]. So
I'm thinking this is 7.4-rcX material.
[*] https://sashiko.dev/#/patchset/cover.1791968227.git.zhuhui@xxxxxxxxxx