Re: [RFC PATCH v5 3/4] mm/vmscan: avoid pointless large folio splits without swap
From: Baolin Wang
Date: Thu Aug 06 2026 - 22:04:09 EST
On 7/30/26 8:23 PM, Xueyuan Chen wrote:
From: "Barry Song (Xiaomi)" <baohua@xxxxxxxxxx>
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 <zhaonanzhe@xxxxxxxxxx>
Signed-off-by: Barry Song (Xiaomi) <baohua@xxxxxxxxxx>
Signed-off-by: Xueyuan Chen <xueyuan.chen21@xxxxxxxxx>
---
LGTM. Feel free to add:
Reviewed-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>