Re: [PATCH v2 06/11] mm/sparse-vmemmap: switch device DAX to shared tail vmemmap pages
From: Muchun Song
Date: Tue Sep 08 2026 - 04:39:29 EST
> On Sep 8, 2026, at 15:46, Qi Zheng <qi.zheng@xxxxxxxxx> wrote:
>
>
>
> On 9/8/26 11:03 AM, Muchun Song wrote:
>> HugeTLB vmemmap optimization now uses per-zone shared tail vmemmap pages.
>> Device DAX has not been switched to that mechanism yet.
>> Switch device DAX to vmemmap_shared_tail_page() as well. This aligns DAX
>> with HugeTLB by using the common per-zone shared tail vmemmap page.
>> The optimization is enabled only for DEV-DAX through pgmap->vmemmap_shift,
>> which is assigned when a DEV-DAX device is initialized. Unlike FS-DAX,
>> DEV-DAX does not modify tail struct pages, so sharing them is safe.
>
> Got it — adding this description makes things significantly clearer.
Aha, also makes Sashiko happy. This time, it is no longer confused
with FS-DAX.
>
>> Since the shared tail page can now back ZONE_DEVICE vmemmap mappings,
>> initialize its entries with PG_reserved for device zones. Also skip
>> poisoning vmemmap-optimizable sections while their struct pages may be
>> shared.
>> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
>> ---
>> v2:
>> - Explain why sharing tail vmemmap pages is safe for DEV-DAX
>> (suggested by Qi Zheng)
>> ---
>> include/linux/mmzone.h | 10 +++++++++
>> mm/memory_hotplug.c | 5 +++--
>> mm/sparse-vmemmap.c | 47 ++++++++++++++----------------------------
>> 3 files changed, 28 insertions(+), 34 deletions(-)
>
> Acked-by: Qi Zheng <qi.zheng@xxxxxxxxx>
Thanks.
>
> Thanks,
> Qi