Re: [PATCH v3 2/3] mm: page_alloc: make the high-order watermark check honour ALLOC_NOFRAGMENT

From: Kiryl Shutsemau (Meta)

Date: Mon Nov 23 2026 - 09:56:46 EST


On Mon, Nov 23, 2026 at 04:11:37PM +0530, Dev Jain wrote:
> But, for the existing callers who pass order > 0 , aren't they also checking
> whether the allocation can be served?

No. kswapd's pgdat_balanced() and kcompactd's __compact_finished() have
no allocation to serve. They are woken with an order and balance the
zone for it. There is no migratetype to pass.

should_reclaim_retry() has an allocation, but it asks whether it could
succeed once everything reclaimable is freed, not whether it can be
served now. Its order-0 part already counts reclaimable pages as free.

> It is confusing me that both alloc_flags and migratetype are logically
> part of the "allocation context" but some callers are doing
> alloc_flags & ~ALLOC_NOFRAGMENT ... I am not sure whether the below
> Sashiko report is related to that, I didn't check in detail:

Only should_reclaim_retry() clears it, and that is what Sashiko flagged.
It keeps what the check did there before the series: it never filtered
by migratetype.

Filtering would send movable order-2/3 requests, like 16K/32K mTHP
faults in a MADV_HUGEPAGE region, to compaction retries and the fallback
sooner. That is a behaviour change of its own and needs its own numbers.
Out-of-scope for the patchset.

--
Kiryl Shutsemau / Kirill A. Shutemov