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

From: Dev Jain

Date: Wed Nov 25 2026 - 03:26:05 EST




On 23/11/26 8:25 pm, Kiryl Shutsemau (Meta) wrote:
> 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.

Okay I read the function again and it makes sense, thanks for explaining.


>