Re: [PATCH -v4 1/4] mm/vmscan: fix anon-only reclaim evicting file pages when swappiness=max

From: Barry Song

Date: Tue Jul 28 2026 - 08:21:14 EST


On Tue, Jul 28, 2026 at 7:53 PM Michal Hocko <mhocko@xxxxxxxx> wrote:
>
> On Tue 28-07-26 18:03:24, Barry Song wrote:
> [...]
> > I understand your point. I just find
> >
> > if (swappiness == SWAPPINESS_ANON_ONLY && sc->proactive)
> >
> > a bit odd, since `swappiness == SWAPPINESS_ANON_ONLY`
> > already implies `sc->proactive`.
>
> It does so very implicitely and you need to look around to learn about
> that. That is my biggest concen here. WARN on is just a very poor
> annotation to remind us about that assumption.
>
> I would much rather have get_scan_count more self explanatory as it is
> quite heavy already.

OK. The only thing that surprises me is that this seems to
leave open the possibility that
`swappiness == SWAPPINESS_ANON_ONLY && !sc->proactive`
is legal. Otherwise, I am fine with it.

If we decide to make this change, it seems we need to do the
same thing in patch 4 as well:

https://lore.kernel.org/linux-mm/20260724033435.2573323-5-ridong.chen@xxxxxxxxx/

Best Regards
Barry