Re: [PATCH v2 2/4] mm/hugetlb: fix two comments related to huge_pmd_unshare()

From: David Hildenbrand (Red Hat)

Date: Sun Dec 21 2025 - 04:26:50 EST



Whoever is the last owner of a (previously) shared page table must unmap any
contained pages (adjust mapcount/ref, sync a/d bit, ...).
Right.
So it's not just a matter of deferring the freeing, because these page tables
will still contain content.
I was (and maybe still) bit confused while reading the old comment as
it implied (or maybe I just misread) that by deferring freeing of page tables
we don't have to flush TLB in __unmap_hugepage_range() and can flush later
instead.

Yeah, I am also confused by the old comment. I think the idea there was to drop the reference only later and thereby deferred-free the page.

My bad. I looked again, and the comment indeed doesn’t make much sense. Thanks for fixing it.

No worries, thanks for taking a look!

--
Cheers

David