Re: [PATCH v3 07/11] mm/hugetlb: use common compound page initialization helper
From: Oscar Salvador (SUSE)
Date: Mon Nov 23 2026 - 04:36:15 EST
On Fri, Nov 20, 2026 at 06:08:52PM +0800, Muchun Song wrote:
> Boot-time gigantic hugetlb folios currently use a separate path to
> initialize their compound struct pages.
>
> Use memmap_init_compound_page() for these folios so that HugeTLB and
> ZONE_DEVICE share the common compound page initialization path. This
> removes the HugeTLB-specific implementation and improves initialization
> performance.
>
> ZONE_DEVICE initializes struct pages by walking one contiguous memory
> range. Boot-time HugeTLB instead initializes multiple disjoint ranges,
> one for each contiguous hugepage. Measurements showed that memcpy()
> performed better than memcpy_nontemporal() for the latter access pattern.
> Therefore, use memcpy() for normal memory while retaining
> memcpy_nontemporal() for ZONE_DEVICE.
>
> The initialization time for 64 boot-time 1G hugepages with 4K base
> pages was measured as follows:
>
> arch without this patch with this patch reduction
> x86-64 195.60 ms 170.40 ms 12.88%
> arm64 374.40 ms 237.60 ms 36.54%
>
> Co-developed-by: Li Zhe <lizhe.67@xxxxxxxxxxxxx>
> Signed-off-by: Li Zhe <lizhe.67@xxxxxxxxxxxxx>
> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
Acked-by: Oscar Salvador (SUSE) <osalvador@xxxxxxxxxx>
--
Oscar Salvador
SUSE Labs