mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Micha Nelissen <micha@neli.hopto.org>
To: Kevin Easton <kevin@guarana.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Why is get_user_pages so slow?
Date: Thu, 12 Aug 2010 12:08:07 +0200	[thread overview]
Message-ID: <4C63C807.102@neli.hopto.org> (raw)
In-Reply-To: <20100812134338.14856uchty1ra39c@guarana.org>

Hi Kevin,

Kevin Easton wrote:
> Yep, you are.  Because your pointer 'p' is a pointer to int, when you 
> increment it by 0x1000 in your loops you are actually incrementing it by 
> 0x1000 * sizeof(int) - so you're only actually touching one page in four.

Oops sorry, thanks for catching my mistake.

I also discovered the following: if I read from all pages, then call 
get_user_pages, it is still quite slow (did I get a read-only page?). 
However, if I touch all pages by writing to them, then get_user_pages 
becomes a factor 40 times faster or so.

All is clear now, I think. Thanks.

Micha

      reply	other threads:[~2010-08-12 10:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-10 19:50 Micha Nelissen
2010-08-12  3:43 ` Kevin Easton
2010-08-12 10:08   ` Micha Nelissen [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=4C63C807.102@neli.hopto.org \
    --to=micha@neli.hopto.org \
    --cc=kevin@guarana.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®