LKML Archive on
help / color / mirror / Atom feed
From: Minchan Kim <>
To: Martijn Coenen <>
Cc: "Minchan Kim" <>,
	"Joel Fernandes" <>,
	LKML <>,
	"Ganesh Mahendran" <>,
	"Joe Perches" <>,
	"Arve Hjønnevåg" <>,
	"Todd Kjos" <>,
	"Greg Kroah-Hartman" <>
Subject: Re: [PATCH v6] ANDROID: binder: change down_write to down_read
Date: Tue, 15 May 2018 17:56:10 +0900	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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.


  reply	other threads:[~2018-05-15  8:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-07 14:15 Minchan Kim
2018-05-07 17:28 ` Joel Fernandes
2018-05-08 10:51   ` Minchan Kim
2018-05-08 23:08     ` Joel Fernandes
2018-05-09  6:40       ` Minchan Kim
2018-05-09 23:19         ` Joel Fernandes
2018-05-15  6:27           ` Minchan Kim
2018-05-15  7:46             ` Martijn Coenen
2018-05-15  8:56               ` Minchan Kim [this message]
2018-05-17  3:23             ` Joel Fernandes

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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH v6] ANDROID: binder: change down_write to down_read' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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