Re: [PATCH 02/12] mm: hugetlb_vmemmap: unify VMEMMAP_{SPLIT,REMAP}_NO_TLB_FLUSH

From: Lance Yang

Date: Wed Oct 21 2026 - 23:52:36 EST



On Tue, Oct 20, 2026 at 07:58:14PM +0800, Muchun Song wrote:
>VMEMMAP_SPLIT_NO_TLB_FLUSH and VMEMMAP_REMAP_NO_TLB_FLUSH do not
>describe fully independent choices. A split-only walk can defer the
>PMD-split flush to a later global flush, and a remap-only walk can
>defer the final remap flush. However, when a PMD split is followed
>by PTE remapping, the split flush must happen before the PTEs are
>changed, because stale large-page translations must not overlap with
>new small-page translations that map different physical pages.
>
>Replace the two flags with a single VMEMMAP_REMAP_NO_TLB_FLUSH flag.
>Keep split-only walks able to defer the flush, but force the split
>flush whenever a remap_pte callback is present. Callers that batch
>HVO work can still defer the final remap flush and issue their own
>global flush.
>
>Current callers keep the same flushing behavior.
>
>Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
>---

Nice work, don't really need two flags anymore :)

If we're going to remap, we still flush after the PMD split, so we can
keep batching the final flush :)

Reviewed-by: Lance Yang <lance.yang@xxxxxxxxx>