Re: [PATCH 8/8] binder: use per-vma lock in page installation

From: Carlos Llamas
Date: Wed Nov 06 2024 - 22:23:14 EST


On Thu, Nov 07, 2024 at 06:55:34AM +0800, Hillf Danton wrote:
> On Tue, 5 Nov 2024 20:02:50 +0000 Carlos Llamas <cmllamas@xxxxxxxxxx>
> > Use per-vma locking for concurrent page installations, this minimizes
> > contention with unrelated vmas improving performance. The mmap_lock is
> > still acquired when needed though, e.g. before folio_walk_start().
> >
> Is the locking order correct in this patch?
>
> lock vma
> lock vma->vm_mm

Sorry, I've also fixed this issue in v2.

I was trying to avoid having to vma_lookup() again after switching
locks. However, this seems unavoidable so I've fixed the locking order
and I've also switched to get_user_pages_remote(). This seems like a
better option now.

--
Carlos Llamas