[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180515085610.GA98128@rodete-desktop-imager.corp.google.com>
Date: Tue, 15 May 2018 17:56:10 +0900
From: Minchan Kim <minchan.kernel@...il.com>
To: Martijn Coenen <maco@...roid.com>
Cc: Minchan Kim <minchan.kernel@...il.com>,
Joel Fernandes <joel@...lfernandes.org>,
LKML <linux-kernel@...r.kernel.org>,
Ganesh Mahendran <opensource.ganesh@...il.com>,
Joe Perches <joe@...ches.com>,
Arve Hjønnevåg <arve@...roid.com>,
Todd Kjos <tkjos@...gle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v6] ANDROID: binder: change down_write to down_read
On Tue, May 15, 2018 at 09:46:01AM +0200, Martijn Coenen wrote:
< snip >
> >> About the unmap at runtime part, your commit message was a bit confusing. You
> >> said "every binder buffers should be mapped in advance by binder_mmap." but I
> >> think the new binder shrinker mechanism doesn't make that true anymore.
> >
> > It's good point. I didn't know know that.
> > When I see binder_vm_fault, it emits SIGBUS. That means shrinker cannot zap pages
> > process is using, I think. IOW, every pages for binder are mapped at mmap time
> > and is never mapped in runtime by page fault. Right?
>
> Right - the address range is allocated once, and an initial amount of
> pages is mapped into it. For every transaction into that process, we
> will see if there's enough pages, and if not allocate so that we have
> enough of them - so this is not done by page fault. The shrinker won't
> touch pages for which a transaction is in progress. Of course a
> process itself could still try to read from an unallocated address,
> but in that case returning SIGBUS and having that process crash seems
> fine.
Thanks for the confirmation.
>
> I'm also not sure the read lock is needed, but I would need to read a
> whole lot more code to convince myself it's not.
For page zapping, we shouldn't need mmap_sem write lock.
We should replace it with down_read/write, too.
Thanks.
Powered by blists - more mailing lists