On Thu, Jul 13, 2023 at 08:32:27PM -0700, Suren Baghdasaryan wrote: > On Tue, Jul 11, 2023 at 1:20 PM Matthew Wilcox (Oracle) > <willy@xxxxxxxxxxxxx> wrote: > > > > The map_pages fs method should be safe to run under the VMA lock instead > > of the mmap lock. This should have a measurable reduction in contention > > on the mmap lock. > > > > Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> > > I'll trust your claim that vmf->vma->vm_ops->map_pages() never rely on > mmap_lock. I think it makes sense but I did not check every case :) Fortunately, there's really only one implementation of ->map_pages() and it's filemap_map_pages(). afs_vm_map_pages() is a thin wrapper around it.