Messages in this thread | | | From | Todd Kjos <> | Date | Tue, 19 Feb 2019 08:54:59 -0800 | Subject | Re: [PATCH] binder: reduce mmap_sem write-side lock |
| |
On Mon, Feb 18, 2019 at 2:47 AM Minchan Kim <minchan@kernel.org> wrote: > > On Mon, Feb 18, 2019 at 09:32:08AM +0100, Greg KH wrote: > > On Mon, Feb 18, 2019 at 05:11:45PM +0900, Minchan Kim wrote: > > > binder has used write-side mmap_sem semaphore to release memory > > > mapped at address space of the process. However, right lock to > > > release pages is down_read, not down_write because page table lock > > > already protects the race for parallel freeing. > > > > > > Please do not use mmap_sem write-side lock which is well known > > > contented lock. > > > > > > Cc: Todd Kjos <tkjos@google.com> > > > Cc: Martijn Coenen <maco@android.com> > > > Cc: Arve Hjønnevåg <arve@android.com> > > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > > > Signed-off-by: Minchan Kim <minchan@kernel.org>
Acked-by: Todd Kjos <tkjos@google.com>
> > > --- > > > drivers/android/binder_alloc.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > Is this just needed for the recent binder changes that are in > > linux-next, or for older kernels as well? > > It has been there for several years but no need to fix older kernels > because down_write of mmap_sem is technically not a bug to stop the > working of binder. Rather than, it's just abuse of the lock so > it's okay to fix only recent kernel. > > Thanks.
| |