[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aUfa5B_DnPP2C6pO@gourry-fedora-PF4VCD3F>
Date: Sun, 21 Dec 2025 06:32:52 -0500
From: Gregory Price <gourry@...rry.net>
To: Wei Yang <richard.weiyang@...il.com>
Cc: Zi Yan <ziy@...dia.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, kernel-team@...a.com,
akpm@...ux-foundation.org, vbabka@...e.cz, surenb@...gle.com,
mhocko@...e.com, jackmanb@...gle.com, hannes@...xchg.org,
osalvador@...e.de, rientjes@...gle.com, david@...hat.com,
joshua.hahnjy@...il.com, fvdl@...gle.com
Subject: Re: [PATCH v6] page_alloc: allow migration of smaller hugepages
during contig_alloc
On Sat, Dec 20, 2025 at 06:37:38AM +0000, Wei Yang wrote:
> On Fri, Dec 19, 2025 at 03:46:25PM -0500, Zi Yan wrote:
> >
> >The sole caller of pfn_range_valid_contig(), alloc_contig_pages_noprof(),
> >scans from the beginning of a zone to the end. pfn_range_valid_contig()
> >should see head pages all the time, except it scans in the middle of
> >a 1GB hugetlb when alloc_contig_pages_noprof() is asking for a smaller
> >nr_pages, like 2MB. But in that case, the if above i += (1 << order) - 1
> >would return false without reaching it. Basically, to get to
> >i += ..., pfn_range_valid_contig() needs to search for nr_pages larger
> >than PageHuge(page) and nr_pages is always power of two based on
> >alloc_contig_pages_noprof() requirement, but that means
> >pfn_range_valid_contig() always sees such PageHuge pages as a whole
> >within nr_pages range, thus cannot see a tail PageHuge page at the
> >point of i += ....
> >
>
> Thanks, I think you are right. For current use case, it is safe.
>
> But I am not sure others could get it on first sight. For example, me :-)
> Do you think it would be helpful to add some comment here?
>
Can't hurt, i'll give this a v7 and collect the tags, thanks!
> Generally LGTM.
>
> Reviewed-by: Wei Yang <richard.weiyang@...il.com>
>
> >Best Regards,
> >Yan, Zi
>
> --
> Wei Yang
> Help you, Help me
Powered by blists - more mailing lists