lkml.org 
[lkml]   [2022]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] binder_alloc: Add missing mmap_lock calls when using the VMA
Date
* Carlos Llamas <cmllamas@google.com> [220809 17:02]:
> On Tue, Aug 09, 2022 at 07:02:17PM +0000, Liam Howlett wrote:
> > >
> > > do we need to hold on to the lock while we loop through the pages here?
> >
> > I think we do? Holding this lock will ensure the pages don't go away, I
> > believe (looking at mm/rmap.c comments on locking at the top)?
> >
> > In any case, this function is called from print_binder_proc_stats()
> > which looks to be a debugfs/debugging call so I thought safer would be
> > better than faster and with a potential race.
>
> The pages are protected by alloc->mutex, so you could immediately
> release the mmap lock after binder_alloc_get_vma() call. I agree this
> is a debugging call so it would be nice to reduce contention.

Oh, I see. The reuse of page confused me here. Yes, you are correct.

I can re-spin this patch.

Thanks,
Liam
\
 
 \ /
  Last update: 2022-08-10 04:05    [W:0.067 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site