mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Darren Hart <dvhart@linux.intel.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@elte.hu
Subject: Re: [RFC PATCH] futex: replace get_user_pages() with get_user_pages_fast()
Date: Thu, 23 Jun 2011 17:44:44 +0200	[thread overview]
Message-ID: <1308843884.1022.142.camel@twins> (raw)
In-Reply-To: <4E035785.6050504@linux.intel.com>

On Thu, 2011-06-23 at 08:11 -0700, Darren Hart wrote:
> 
> On 06/22/2011 11:21 PM, KOSAKI Motohiro wrote:
> > Hello,
> > 
> > Is there any reason to take mmap_sem explicitly here?
> > Should we change gup_fast() to allow NULL argument (ie for avoid get_page)?
> > 
> > ============================
> >   down_read(&mm->mmap_sem);
> >   get_user_pages(current, current->mm)
> >   up_read(&mm->mmap_sem);
> > 
> > and
> > 
> >   get_user_pages_fast()
> > 
> > make an equivalent result, And latter would be better when mamp_sem
> > highly contended case, because it can avoid to take mmap_sem if
> > the target page doesn't need a page fault.
> 
> 
> I can't speak authoritatively here, but it seems to me that
> get_user_pages_fast falls back to get_user_pages with mmap_sem anyway,
> so this seems like a reasonable optimization for the best case, with a
> minor overhead for the slow case.
> 
> Peter, am I missing something? 

Right, its much cheaper on the fast-path where the page is found present
and writable, if we have to take the fault, the extra cost in the slow
path is neglectable.

> Is there a reason you left this as is
> during your fast gup futex update?

I probably completely missed this gup() user.

The proposed change looks good to me.

      reply	other threads:[~2011-06-23 15:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-23  6:21 KOSAKI Motohiro
2011-06-23 15:11 ` Darren Hart
2011-06-23 15:44   ` Peter Zijlstra [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=1308843884.1022.142.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=dvhart@linux.intel.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®