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

From: Carlos Llamas
Date: Tue Nov 05 2024 - 16:44:42 EST


On Tue, Nov 05, 2024 at 08:02:50PM +0000, Carlos Llamas wrote:
> +static struct page *binder_page_lookup(struct mm_struct *mm,
> + struct vm_area_struct *vma,
> + unsigned long addr,
> + bool mm_locked)
> +{
> + struct folio_walk fw;
> + struct page *page;
> +
> + /* folio_walk_start() requires the mmap_lock */
> + if (!mm_locked)
> + mmap_read_lock(mm);
> +
> + if (!folio_walk_start(&fw, vma, addr, 0))
> + return NULL;

Just realized that mmap_lock need to be released if folio_walk_start()
fails and !mm_locked. I'll add the fix for v2.