Re: [PATCH v2 06/17] mm/mm_init: factor out pfn_to_zone()
From: Muchun Song
Date: Mon Jul 20 2026 - 07:37:27 EST
> On Jul 20, 2026, at 17:31, Muchun Song <songmuchun@xxxxxxxxxxxxx> wrote:
>
> pfn_to_zone() in hugetlb_vmemmap.c duplicates the zone lookup logic in
> __init_deferred_page().
>
> Move it to mm_init.c, declare it in mm/internal.h, and reuse it from
> __init_deferred_page() and HugeTLB early vmemmap initialization instead
> of open-coding the zone walk there.
Sashiko said "The commit message states that pfn_to_zone() is declared
in mm/internal.h, but the patch actually adds the declaration to mm/mm_init.h
instead". That is indeed an issue. When I was handling the rebase, I forgot
to update the commit message here due to code conflicts. I will fix this in
the next version.
Thanks.