Re: [PATCH] hugetlb: retry private VMA locking when unmapping folios
From: Daehyeon Ko
Date: Tue Oct 20 2026 - 06:26:40 EST
Hi David,
Yes, that makes sense.
The per-index fault mutex excludes concurrent faults for the folio being
removed, while i_mmap_rwsem keeps the VMA in the mapping tree and excludes
concurrent page-table teardown. So the private resv_map lock is not needed
in this path.
I tested the exact diff from your message on v7.3-rc5 with KASAN+LOCKDEP.
My unprivileged mprotect()/hole-punch reproducer completed 1,000 rounds
(64,000 hole punches) with no KASAN, lockdep, unexpected warning, oops, or
panic.
Please consider my patch superseded by Josef's fix.
One small typo in the quoted comment: "i_mmap_rwsem everybody" appears to
be missing "excludes".
The quoted commit also predates the current linux-next policy change:
`Assisted-by` is no longer a recognized trailer. `generated-content.rst`
asks that tool-assisted discovery be stated in the changelog prose instead.
Tested-by: Daehyeon Ko <4ncienth@xxxxxxxxx>
Thanks,
Daehyeon