public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: Hideo Saito <saito@densan.co.jp>
Cc: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: follow_page() performance regressions
Date: Tue, 1 Jul 2008 14:25:43 +0900	[thread overview]
Message-ID: <20080701052543.GA4726@linux-sh.org> (raw)
In-Reply-To: <20080701.132439.68562265.saito@densan.co.jp>

(adding Linus and l-k to Cc..)

On Tue, Jul 01, 2008 at 01:24:39PM +0900, Hideo Saito wrote:
> I have a question as to performance of kernel on linux-2.6.25.9, but
> this may be off-topic, because the problem is not related to the SH
> architecture directly.
> 
> When I tested Hackbench benchmark test on our platform(SH7780, 400MHz),
> the performance decreases as follows.
> 
> The result on linux-2.6.25.9:
> #tcsh> ./hackbench 40 ; time ./hackbench 40 ; time ./hackbench 40
> Time: 69.858
> Time: 69.810
> Time: 70.356
> 
> The result on linux-2.6.25.8:
> #tcsh> ./hackbench 40 ; time ./hackbench 40 ; time ./hackbench 40
> Time: 65.353
> Time: 65.622
> Time: 65.413
> 
> I confirmed that the cause is in the following changes. Isn't this
> decrease of performance avoided, though it seems that this code is
> changed in order to handle ZERO_PAGE?
> 
> --- a/mm/memory.c
> +++ b/mm/memory.c
>     pte = *ptep;
>     if (!pte_present(pte))
> -       goto unlock;
> +       goto no_page;
>     if ((flags & FOLL_WRITE) && !pte_write(pte))
>         goto unlock;
>     page = vm_normal_page(vma, address, pte);
>     if (unlikely(!page))
> -       goto unlock;
> +       goto bad_page;
> 
>     if (flags & FOLL_GET)
>         get_page(page);

git blame points to:

commit 89f5b7da2a6bad2e84670422ab8192382a5aeb9f
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Fri Jun 20 11:18:25 2008 -0700

    Reinstate ZERO_PAGE optimization in 'get_user_pages()' and fix XIP

...

So yes, the ZERO_PAGE handling in follow_page() is causing the slow-down here.

       reply	other threads:[~2008-07-01  5:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080701.132439.68562265.saito@densan.co.jp>
2008-07-01  5:25 ` Paul Mundt [this message]
2008-07-01 15:43   ` follow_page() performance regressions Linus Torvalds
2008-07-01 16:35     ` Linus Torvalds
2008-07-03  1:57       ` Hideo Saito

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=20080701052543.GA4726@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=saito@densan.co.jp \
    --cc=torvalds@linux-foundation.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