Re: [PATCH v3 12/12] mm: hugetlb_vmemmap: make vmemmap PTE conversion folio-oriented

From: Muchun Song

Date: Fri Nov 06 2026 - 03:56:21 EST




> On Nov 5, 2026, at 17:26, Oscar Salvador (SUSE) <osalvador@xxxxxxxxxx> wrote:
>
> 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>

Thanks for your review.

>
> 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.
>

Since I'll be sending an updated version anyway, I'll also remove
the eligibility check from vmemmap_pteify_folio().

Thanks,
Muchun

>
> --
> Oscar Salvador
> SUSE Labs