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

From: Matthew Wilcox

Date: Mon Feb 23 2026 - 13:19:36 EST


On Mon, Feb 16, 2026 at 10:06:57AM +0100, David Hildenbrand (Arm) wrote:
> On 2/16/26 00:13, Matthew Wilcox wrote:
> > On Mon, Feb 02, 2026 at 03:56:24PM +0000, Kiryl Shutsemau wrote:
> > > With the upcoming changes to HVO, a single page of tail struct pages
> > > will be shared across all huge pages of the same order on a node. Since
> > > huge pages on the same node may belong to different zones, the zone
> > > information stored in shared tail page flags would be incorrect.
> > >
> > > Always fetch zone information from the head page, which has unique and
> > > correct zone flags for each compound page.
> >
> > 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.