Re: [RFC PATCH 3/5] mm/page_alloc: convert any movable pageblock on a non-movable allocation

From: Johannes Weiner

Date: Wed Oct 14 2026 - 16:54:02 EST


On Tue, Oct 06, 2026 at 10:12:48PM -0400, Rik van Riel wrote:
> try_to_claim_block() converts a movable pageblock for a non-movable
> allocation only when half its pages are free or compatible.
> Otherwise the steal path takes pages without converting, and
> non-movable content sits in a block still typed movable.
>
> Convert a movable block on any non-movable claim, however few of
> its pages are free, so the block's type matches the allocation it
> serves.
>
> When other pages in the block are freed later, they end up on the
> non-movable free lists, directing more non-movable allocations to
> the already non-movable page blocks.
>
> Converting a non-movable pageblock to movable is made stricter:
> a movable claim takes a non-movable block only when every page
> is free or movable.
>
> Blocks straddling a zone edge are never claimed;
> zone_spans_pageblock() tests for a block wholly inside its zone.
>
> Assisted-by: LLM
> Signed-off-by: Rik van Riel <riel@xxxxxxxxxxx>

I like this in theory, but wonder how this behaves in practice.

The block is claimed, but the movable constituents aren't proactively
kicked out. The next unmovable request might well claim another mostly
movable block, and so forth. With a flurry of short-lived unmovable
allocations, this might explode the unmovable blocks, which will be
hard to recover especially when you raise the bar on *that* direction.