public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Carlos Llamas <cmllamas@google.com>
To: David Hildenbrand <david@redhat.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Todd Kjos" <tkjos@android.com>,
	"Martijn Coenen" <maco@android.com>,
	"Joel Fernandes" <joel@joelfernandes.org>,
	"Christian Brauner" <brauner@kernel.org>,
	"Suren Baghdasaryan" <surenb@google.com>,
	linux-kernel@vger.kernel.org, kernel-team@android.com,
	"Barry Song" <v-songbaohua@oppo.com>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>
Subject: Re: [PATCH v3 2/8] binder: concurrent page installation
Date: Tue, 12 Nov 2024 15:15:30 +0000	[thread overview]
Message-ID: <ZzNxEsF2HjQzI0ak@google.com> (raw)
In-Reply-To: <4eac810c-60e5-409d-a4a3-452461ace9bb@redhat.com>

On Tue, Nov 12, 2024 at 03:53:51PM +0100, David Hildenbrand wrote:
> On 12.11.24 15:43, Carlos Llamas wrote:
> > On Tue, Nov 12, 2024 at 12:10:20PM +0100, David Hildenbrand wrote:
> > > On 08.11.24 20:10, Carlos Llamas wrote:
> > > > +	ret = vm_insert_page(vma, addr, page);
> > > > +	switch (ret) {
> > > > +	case -EBUSY:
> > > > +		/*
> > > > +		 * EBUSY is ok. Someone installed the pte first but the
> > > > +		 * lru_page->page_ptr has not been updated yet. Discard
> > > > +		 * our page and look up the one already installed.
> > > > +		 */
> > > > +		ret = 0;
> > > > +		__free_page(page);
> > > > +		npages = get_user_pages_remote(alloc->mm, addr, 1, 0, &page, NULL);
> > > 
> > > This will trigger a page fault if we don't find what we expect (are races
> > > with e.g., MADV_DONTNEED possible?), is that really desired or not a
> > > problem?
> > 
> > This is fine. As of now, binder blocks its page faults:
> > 
> > 	static vm_fault_t binder_vm_fault(struct vm_fault *vmf)
> > 	{
> > 		return VM_FAULT_SIGBUS;
> > 	}
> > 
> > If we race with something like MADV_DONTNEED then we would just
> > propagate the -EFAULT error. I could add FOLL_NOFAULT to the gup remote
> > call to make it evident we don't care though.
> 
> Might make it clearer ... or at least adding a comment how this is supposed
> to work. :)

Sounds good. I'll add both FOLL_NOFAULT flag and a comment for v4.

Cheers,
Carlos Llamas

  reply	other threads:[~2024-11-12 15:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-08 19:10 [PATCH v3 0/8] binder: faster page installations Carlos Llamas
2024-11-08 19:10 ` [PATCH v3 1/8] Revert "binder: switch alloc->mutex to spinlock_t" Carlos Llamas
2024-11-08 19:10 ` [PATCH v3 2/8] binder: concurrent page installation Carlos Llamas
2024-11-08 20:41   ` Liam R. Howlett
2024-11-08 22:26     ` Carlos Llamas
2024-11-09  3:58       ` Liam R. Howlett
2024-11-12 11:10   ` David Hildenbrand
2024-11-12 14:43     ` Carlos Llamas
2024-11-12 14:53       ` David Hildenbrand
2024-11-12 15:15         ` Carlos Llamas [this message]
2024-11-08 19:10 ` [PATCH v3 3/8] binder: select correct nid for pages in LRU Carlos Llamas
2024-11-08 19:10 ` [PATCH v3 4/8] binder: remove struct binder_lru_page Carlos Llamas
2024-11-08 19:10 ` [PATCH v3 5/8] binder: replace alloc->vma with alloc->mapped Carlos Llamas
2024-11-08 19:10 ` [PATCH v3 6/8] binder: rename alloc->buffer to vm_start Carlos Llamas
2024-11-08 19:10 ` [PATCH v3 7/8] binder: use per-vma lock in page installation Carlos Llamas
2024-11-08 19:10 ` [PATCH v3 8/8] binder: propagate vm_insert_page() errors Carlos Llamas

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=ZzNxEsF2HjQzI0ak@google.com \
    --to=cmllamas@google.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=arve@android.com \
    --cc=brauner@kernel.org \
    --cc=david@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joel@joelfernandes.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maco@android.com \
    --cc=surenb@google.com \
    --cc=tkjos@android.com \
    --cc=v-songbaohua@oppo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox