linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Andrew Morton <akpm@osdl.org>, Hugh Dickins <hugh@veritas.com>,
	Andi Kleen <ak@suse.de>,
	davem@davemloft.net, Linus Torvalds <torvalds@osdl.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] page table iterators
Date: Mon, 21 Feb 2005 19:09:11 +1100	[thread overview]
Message-ID: <42199727.2010309@yahoo.com.au> (raw)
In-Reply-To: <1108969783.5411.6.camel@gaston>

Benjamin Herrenschmidt wrote:

> All of them are slightly differently implemented, some check overflow,
> some don't, some have redudant checking, some aren't even consistent
> between all 3/4 loops of a given walk routine set, and we have seen the
> tendency to introduce subtle bugs in one of them when they all have to
> be changed for some reason.
> 
> I'm all for turning them into something more consistent, and I like the
> for_each_* idea...
> 
> It also allows to completely remove the code of the unused levels on 2
> and 3 level page tables easily, regaining some of the perfs lost by the
> move to 4 levels.
> 

It appears to do even better on 2-levels (i386, !PAE) than the old
3-level code, not surprisingly. lmbench fork+exit overhead is under
100us on a 3.4GHz xeon now, which is the lowest I've seen.

Haven't yet pulled out a pre-4-level kernel to see how 3-level compares
I guess I'll do that now.

> Now, we also need, in the long run, to improve perfs of walking the page
> tables, especially PTEs, for things like tearing down processes or fork,
> for example via a bitmap of used PGD entries etc... 
> 
> With proper iterators, such a thing could be implemented just by
> modifying the iterator, and all loops would benefit from it.
> 

After looking at David's bitmap walking code, I'm starting to think
that my current macros only _just_ scrape by because of the uniform
nature of the walkers, and their relative simplicity. Anything much
more complex will start to get ugly.

I'd like to look at a slightly more involved reworking in order to
nicely support optimisations like bitmap walking, without blowing out
the complexity of the macros and without hiding too much of the
workings.

However, my main aim for these macros was mainly to fix the
performance regressions on 2 and 3 level architectures. Ben's
complaints about these loops just served to hurry it along. I think
that these reasons (performance, code consistency) make it a good
idea.

Nick


  reply	other threads:[~2005-02-21  8:09 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-17 13:53 [PATCH 1/2] optimise copy page range Nick Piggin
2005-02-17 14:03 ` [PATCH 2/2] page table iterators Nick Piggin
2005-02-17 15:56   ` Linus Torvalds
2005-02-17 16:13     ` Nick Piggin
2005-02-17 19:43   ` Andi Kleen
2005-02-17 22:49     ` Benjamin Herrenschmidt
2005-02-17 23:03       ` Andi Kleen
2005-02-17 23:21         ` Benjamin Herrenschmidt
2005-02-17 23:34           ` Andi Kleen
2005-02-17 23:30         ` David S. Miller
2005-02-17 23:57           ` Andi Kleen
2005-02-20 12:35             ` Nick Piggin
2005-02-21  6:35               ` Hugh Dickins
2005-02-21  6:40                 ` Andrew Morton
2005-02-21  7:09                   ` Benjamin Herrenschmidt
2005-02-21  8:09                     ` Nick Piggin [this message]
2005-02-21  9:04                       ` Nick Piggin
2005-02-22  9:54                 ` Nick Piggin
2005-02-23  2:06                   ` Hugh Dickins
2005-02-23  4:31                     ` David S. Miller
2005-02-23  4:49                       ` Nick Piggin
2005-02-23  4:57                         ` David S. Miller
2005-02-23  5:23                       ` Nick Piggin
2005-02-23 23:52                     ` Nick Piggin
2005-02-24  0:00                       ` David S. Miller
2005-02-24  5:12                       ` Hugh Dickins
2005-02-24  5:59                         ` Nick Piggin
2005-02-24 11:58                           ` Hugh Dickins
2005-02-24 19:33                             ` David S. Miller
2005-02-25 10:44                               ` Andi Kleen
2005-02-24 21:59                             ` Nick Piggin
2005-02-24 22:32                               ` Hugh Dickins
2005-02-24 22:52                                 ` Nick Piggin

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=42199727.2010309@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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;
as well as URLs for NNTP newsgroup(s).