Re: [PATCH -v4 1/4] mm/vmscan: fix anon-only reclaim evicting file pages when swappiness=max
From: Michal Hocko
Date: Mon Jul 27 2026 - 04:23:26 EST
On Fri 24-07-26 11:34:32, Ridong wrote:
> From: Ridong Chen <chenridong@xxxxxxxxxx>
>
> As Qi mentioned [1], when swappiness=max (SWAPPINESS_ANON_ONLY) is set,
> the reclaim logic is expected to reclaim anonymous pages exclusively.
> However, due to the current ordering of checks in get_scan_count(),
> file pages may still be evicted if can_reclaim_anon_pages() returns
> false, which contradicts the semantics of SWAPPINESS_ANON_ONLY.
But if can_reclaim_anon_pages tells us that anonymous pages are not
reclaimable then it makes no sense to try that, no? What do you expect
to see? An OOM killer?
--
Michal Hocko
SUSE Labs