Re: [RFC PATCH v5 3/4] mm/vmscan: avoid pointless large folio splits without swap

Baolin Wang <[email protected]> Fri, 7 Aug 2026 10:03:51 +0800
Newsgroups org.kernel.vger.cgroups,org.kernel.vger.linux-kernel,org.kvack.linux-mm
Message-ID <[email protected]>

On 7/30/26 8:23 PM, Xueyuan Chen wrote:
> From: "Barry Song (Xiaomi)" <[email protected]>
> 
> When swap is disabled, exhausted, or unavailable due to memcg swap
> limits, splitting a large anonymous folio cannot make swapout progress.
> The fallback only destroys the large folio and inflates split statistics.
> 
> Use -E2BIG from folio_alloc_swap() as the explicit signal that splitting
> the folio might allow swapout of smaller pieces. For other allocation
> failures, keep the existing activation path and avoid the split.
> 
> This preserves the split fallback for fragmented or partially available
> swap, while avoiding it when there is no backing space for any part of the
> folio.
> 
> Reported-by: Nanzhe Zhao <[email protected]>
> Signed-off-by: Barry Song (Xiaomi) <[email protected]>
> Signed-off-by: Xueyuan Chen <[email protected]>
> ---

LGTM. Feel free to add:
Reviewed-by: Baolin Wang <[email protected]>