Re: [PATCHv6 08/17] mm: Make page_zonenum() use head page

David Hildenbrand (Arm)
2026-02-23T19:32:43Z

On 2/23/26 19:18, Matthew Wilcox wrote:
> On Mon, Feb 16, 2026 at 10:06:57AM +0100, David Hildenbrand (Arm) wrote:
>> On 2/16/26 00:13, Matthew Wilcox wrote:
>>>
>>> You're right that different pages in the same folio can have different
>>> zone number. But does it matter ... or to put it another way, why is
>>> returning the zone number of the head page the correct way to resolve
>>> this?
>>
>> How can a folio cross zones?
>
> I thought 1GB pages in hugetlb could cross zones? Maybe that used to be
> true and isn't any more, or maybe it was never true and I was just
> confused.

I recall that 1G folios could end up in ZONE_MOVABLE (comment in
page_is_unmovable()), but my memory is fuzzy when it comes to crossing
zones (ZONE_NORMAL -> ZONE_MOVABLE).

Freeing+reinitializing the vmemmap for HVO with such folios would
already be problematic I suppose: we would silently switch the zone for
some of these pages.

When freeing such (boottime) hugetlb folios to the buddy, we use
free_frozen_pages(). In there we lookup the zone once.

Likely also problematic :)

--
Cheers,

David