All of lore.kernel.org
 help / color / mirror / Atom feed
From: Minchan Kim <minchan@kernel.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"Todd Kjos" <tkjos@google.com>,
	"Martijn Coenen" <maco@android.com>,
	"Arve Hjønnevåg" <arve@android.com>
Subject: Re: [PATCH] binder: reduce mmap_sem write-side lock
Date: Mon, 18 Feb 2019 19:47:25 +0900	[thread overview]
Message-ID: <20190218104725.GA160999@google.com> (raw)
In-Reply-To: <20190218083208.GA20069@kroah.com>

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>
> > ---
> >  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.

  reply	other threads:[~2019-02-18 10:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-18  8:11 [PATCH] binder: reduce mmap_sem write-side lock Minchan Kim
2019-02-18  8:32 ` Greg KH
2019-02-18 10:47   ` Minchan Kim [this message]
2019-02-19 16:54     ` Todd Kjos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190218104725.GA160999@google.com \
    --to=minchan@kernel.org \
    --cc=arve@android.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maco@android.com \
    --cc=tkjos@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.