Re: [PATCH v6] page_alloc: allow migration of smaller hugepages during contig_alloc

From: Gregory Price

Date: Fri Dec 19 2025 - 09:27:19 EST


On Fri, Dec 19, 2025 at 12:08:00AM +0000, Wei Yang wrote:
> >+
> >+ page = compound_head(page);
> >+ order = compound_order(page);
>
> The order is get from head page.
>
> >+ if ((order >= MAX_FOLIO_ORDER) ||
> >+ (nr_pages <= (1 << order)))
> >+ return false;
> >+
> >+ /* No need to check the pfns for this page */
> >+ i += (1 << order) - 1;
>
> So this advance should based on "head page" instead of original page, right?
>

hm, I think the thought here was that since we're moving forward from
start of an aligned chunk, we'd never hit a non-head page - but this
may not be true.

Will think about this for a bit.

~Gregory