From: Todd Kjos <tkjos@google.com>
To: Minchan Kim <minchan@kernel.org>
Cc: "Greg KH" <gregkh@linuxfoundation.org>,
LKML <linux-kernel@vger.kernel.org>,
"Martijn Coenen" <maco@android.com>,
"Arve Hjønnevåg" <arve@android.com>
Subject: Re: [PATCH] binder: reduce mmap_sem write-side lock
Date: Tue, 19 Feb 2019 08:54:59 -0800 [thread overview]
Message-ID: <CAHRSSEy7bHsVr9CSbybRU0SvL2EHoWbF0wyZi72FJPXyPMDj+Q@mail.gmail.com> (raw)
In-Reply-To: <20190218104725.GA160999@google.com>
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.
prev parent reply other threads:[~2019-02-19 16:55 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
2019-02-19 16:54 ` Todd Kjos [this message]
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=CAHRSSEy7bHsVr9CSbybRU0SvL2EHoWbF0wyZi72FJPXyPMDj+Q@mail.gmail.com \
--to=tkjos@google.com \
--cc=arve@android.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maco@android.com \
--cc=minchan@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).