From: Andrew Morton <akpm@linux-foundation.org>
To: Carlos Llamas <cmllamas@google.com>
Cc: "Liam Howlett" <liam.howlett@oracle.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
syzbot <syzbot+a7b60a176ec13cafb793@syzkaller.appspotmail.com>,
"Ondrej Mosnacek" <omosnace@redhat.com>,
"syzkaller-bugs@googlegroups.com"
<syzkaller-bugs@googlegroups.com>,
"Minchan Kim" <minchan@kernel.org>,
"Christian Brauner" <brauner@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Hridya Valsaraju" <hridya@google.com>,
"Joel Fernandes" <joel@joelfernandes.org>,
"Martijn Coenen" <maco@android.com>,
"Suren Baghdasaryan" <surenb@google.com>,
"Todd Kjos" <tkjos@android.com>,
"Matthew Wilcox" <willy@infradead.org>,
"Arve Hjønnevåg" <arve@android.com>
Subject: Re: [PATCH] binder_alloc: Add missing mmap_lock calls when using the VMA
Date: Tue, 9 Aug 2022 18:30:12 -0700 [thread overview]
Message-ID: <20220809183012.ac2d52eb91eba55a12d3214a@linux-foundation.org> (raw)
In-Reply-To: <YvLLQ/qasEJffdnn@google.com>
On Tue, 9 Aug 2022 21:01:55 +0000 Carlos Llamas <cmllamas@google.com> wrote:
> 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.
I'll queue this patch for testing, shall update it if there's a v2.
next prev parent reply other threads:[~2022-08-10 1:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-09 16:06 [PATCH] binder_alloc: Add missing mmap_lock calls when using the VMA Liam Howlett
2022-08-09 18:49 ` Carlos Llamas
2022-08-09 19:02 ` Liam Howlett
2022-08-09 21:01 ` Carlos Llamas
2022-08-10 1:30 ` Andrew Morton [this message]
2022-08-10 2:04 ` Liam Howlett
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=20220809183012.ac2d52eb91eba55a12d3214a@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=arve@android.com \
--cc=brauner@kernel.org \
--cc=cmllamas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=hridya@google.com \
--cc=joel@joelfernandes.org \
--cc=liam.howlett@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=maco@android.com \
--cc=minchan@kernel.org \
--cc=omosnace@redhat.com \
--cc=surenb@google.com \
--cc=syzbot+a7b60a176ec13cafb793@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=tkjos@android.com \
--cc=willy@infradead.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).