On 01/19/23 18:07, Peter Xu wrote: > > Actually when revisiting the locks I'm getting a bit confused on whether > the vma lock is needed if pmd sharing is anyway forbidden for HGM. I > raised a question in the other patch of MADV_COLLAPSE, maybe they're > related questions so we can keep it there. I can quickly answer that. Yes. The vma lock is also being used for fault/truncation synchronization. Commit e700898fa075 make sure it is even used on architectures that do not support PMD sharing. I had come up with a rather ugly method of using the fault mutex for fault/truncation synchronization, but using the vma lock was more elegant. -- Mike Kravetz