Re: [PATCH v3 12/12] mm: hugetlb_vmemmap: make vmemmap PTE conversion folio-oriented
From: Oscar Salvador (SUSE)
Date: Thu Nov 05 2026 - 04:31:39 EST
On Wed, Nov 04, 2026 at 10:35:10AM +0800, Muchun Song wrote:
> Converting a folio's vmemmap mappings from PMDs to PTEs is a per-folio
> operation, but the current interface exposes a raw address range and
> hardcodes deferred TLB flushing. This splits the common mechanism
> across layers and couples it to the HugeTLB batching policy.
>
> Make the folio the unit of PTE conversion and let callers select the TLB
> flush policy through the folio-oriented interface. This keeps
> HugeTLB-specific eligibility and batching outside the common operation.
>
> No functional change intended.
>
> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
> Reviewed-by: Lance Yang <lance.yang@xxxxxxxxx>
> Reviewed-by: Qi Zheng <qi.zheng@xxxxxxxxx>
> Reviewed-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
Reviewed-by: Oscar Salvador <osalvador@xxxxxxx>
But I have to say that I would put the vmemmap_optimizable_order() check
upfront in the caller, so by the time we call vmemmap_pteify_folio()
we now we can proceed.
--
Oscar Salvador
SUSE Labs