Re: [PATCH v5 16/17] mm/hugetlb: localize struct huge_bootmem_page
From: Qi Zheng
Date: Tue Aug 25 2026 - 09:50:47 EST
On 8/25/26 4:46 PM, Muchun Song wrote:
struct huge_bootmem_page is only used by hugetlb boot-time allocation
code, but its definition currently lives in mm/internal.h because
hugetlb_vmemmap_optimize_bootmem_page() takes it as an argument. This
exposes a hugetlb-specific internal type more broadly than needed.
Change hugetlb_vmemmap_optimize_bootmem_page() to take the information it
actually needs. With that interface, mm/hugetlb_vmemmap.h no longer needs
to include mm/internal.h, and struct huge_bootmem_page can move into
mm/hugetlb.c.
Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
Acked-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
---
v2:
- Pass PFN and order to hugetlb_vmemmap_optimize_bootmem_page() instead
of struct hstate and bootmem metadata to simplify the code further
- Collect Acked-by from Mike Rapoport
---
mm/hugetlb.c | 8 +++++++-
mm/hugetlb_vmemmap.c | 8 +++-----
mm/hugetlb_vmemmap.h | 5 ++---
mm/internal.h | 7 -------
4 files changed, 12 insertions(+), 16 deletions(-)
Acked-by: Qi Zheng <qi.zheng@xxxxxxxxx>
Thanks,
Qi