linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Dave Hansen <haveblue@us.ibm.com>
Cc: Andy Whitcroft <apw@shadowen.org>, linux-mm@kvack.org
Subject: Re: [PATCH] Get rid of zone_table
Date: Wed, 13 Sep 2006 14:40:25 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0609131425010.19380@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <1158180795.9141.158.camel@localhost.localdomain>

On Wed, 13 Sep 2006, Dave Hansen wrote:

> > The section_to_node table (if we still need it) is still the size of the 
> > number of sections but the individual elements are integers (which already 
> > saves 50% on 64 bit platforms) and we do not need to duplicate the entries 
> > per zone type. So even if we have to keep the table then we shrink it to 
> > 1/4th (32bit) or 1/8th )(64bit).
> 
> It doesn't feel like this is the best fit to go with sparsemem, but the
> impact is pretty tiny, and it does seem somewhat sensible to put it
> there.
> 
> A few concerns: is there a cache or readability impact from keeping this
> structure separate from the mem_section, when it is logically and
> functionally pretty paired with it?  It doesn't work with
> SPARSEMEM_EXTREME (it would just blow up horribly), and this part at
> least deserves a comment.  Is there any impact from making this a
> non-inlined call, unlike the old zonetable lookup?

I am not that familiar with sparsemem thats why I asked you about it at 
first. I doubt there is much of an impact from making this non inlined. 
IMHO it is clearer and easier to maintain if the code to do the section 
lookup is put with the code that generates the sections. Its also an 
exceptional thing that is not needed in general.

The main performance issue is probably the number of cachelines touched 
and the situation gets better here even for the worst case that we have to 
keep a separate lookup array. The array is denser.

For page_zone(page) one would have to do two lookups in the worst case. 
One to get the node id and then another one in NODE_DATA() to get to the 
zone. However, the NODE_DATA()is frequently referenced so its likely to be 
in cache. The existing 3 lookups for page_to_nid() are reduced 
to a single lookup in the section_to_node_table(). Before we had to
determine the zone and then fetch the corresponding pgdat address and then 
fetch the node number from the pgdat structure (yuck).

You could put the node number with the section (put it in a separate 
cacheline before the start of the memsection array?) but then it would be 
in a cacheline of its own. This way you have the node number of a set of 
neighboring sections in one cacheline. With a 128 byte cacheline you 
have the nodes for the 32 neighboring section of memory.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2006-09-13 21:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-13 20:44 Christoph Lameter
2006-09-13 20:53 ` Dave Hansen
2006-09-13 21:40   ` Christoph Lameter [this message]
2006-09-13 21:47     ` Dave Hansen
2006-09-13 21:54       ` Christoph Lameter
2006-09-13 21:58         ` Dave Hansen
2006-09-13 22:02           ` Christoph Lameter
2006-09-15 13:28       ` Andy Whitcroft
2006-09-15 16:32         ` Dave Hansen
2006-09-15 17:13         ` Christoph Lameter
2006-09-15 17:51           ` Christoph Lameter
2006-09-14 10:33 ` Andy Whitcroft
2006-09-14 21:46   ` Christoph Lameter
2006-09-15 13:07     ` Andy Whitcroft

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=Pine.LNX.4.64.0609131425010.19380@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=apw@shadowen.org \
    --cc=haveblue@us.ibm.com \
    --cc=linux-mm@kvack.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