Re: [RFC PATCH] mm: Avoiding split large folios if swap has no space

From: David Hildenbrand (Arm)

Date: Fri Jun 19 2026 - 10:04:13 EST


On 6/19/26 00:17, Barry Song (Xiaomi) wrote:
> When swap is disabled or exhausted, swap slot allocation
> may fail during swapout, causing large folios to be split
> into small folios. The splitting is reasonable when we
> truly fail to obtain contiguous swap slots, but it is
> pointless in the no-space case.
>
> A simple way to reproduce this is to invoke MADV_PAGEOUT on
> a system with mTHP enabled but without swap configured.

Would we ever run into that code without MADV_PAGEOUT, or is that a
MADV_PAGEOUT-special thing?

I recall that can_reclaim_anon_pages() would make vmscan skip such code, but
it's tricky.

--
Cheers,

David