Re: [PATCH v3] mm: use per_vma lock for MADV_DONTNEED
From: Matthew Wilcox
Date: Sat Jun 07 2025 - 00:05:21 EST
On Sat, Jun 07, 2025 at 12:46:23PM +1200, Barry Song wrote:
> To simplify handling, the implementation falls back to the standard
> mmap_lock if userfaultfd is enabled on the VMA, avoiding the complexity of
> userfaultfd_remove().
This feels too complex to me. Why do we defer grabbing the vma lock
so late, instead of grabbing it at the start like the fault handler does?