linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Christoph Lameter <clameter@sgi.com>
Cc: linux-mm@kvack.org, Andy Whitcroft <apw@shadowen.org>,
	Dave Hansen <haveblue@us.ibm.com>
Subject: Re: [PATCH] Get rid of zone_table V2
Date: Mon, 18 Sep 2006 16:15:28 -0700	[thread overview]
Message-ID: <20060918161528.9714c30c.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0609181544420.29365@schroedinger.engr.sgi.com>

On Mon, 18 Sep 2006 15:51:25 -0700 (PDT)
Christoph Lameter <clameter@sgi.com> wrote:

> On Mon, 18 Sep 2006, Andrew Morton wrote:
> 
> > On Mon, 18 Sep 2006 12:21:35 -0700 (PDT)
> > Christoph Lameter <clameter@sgi.com> wrote:
> > 
> > > The zone table is mostly not needed. If we have a node in the
> > > page flags then we can get to the zone via NODE_DATA() which
> > > is much more likely to be already in the cpu cache.
> > 
> > Adds a couple of hundred bytes of text to an x86 SMP build.  Any
> > idea why?  If it's things like page_zone() getting porkier then that's
> > a bit unfortunate - that's rather fastpath material.
> 
> In an SMP/UP configuration we do not need to do any lookup since 
> NODE_DATA() is constant. We calculate the address of the zone which may be 
> more code than a lookup.

So it looks like we've made UP and small SMP worse, while providing some
undescribed level of benefit to big NUMA?  Not a popular tradeoff, that.

We call page_zone() rather a lot, and looking at the proposed new version
is scary:


static inline enum zone_type page_zonenum(struct page *page)
{
	return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK;
}

static inline unsigned long page_to_nid(struct page *page)
{
	return (page->flags >> NODES_PGSHIFT) & NODES_MASK;
}

static inline struct zone *page_zone(struct page *page)
{
	return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)];
}

Not only does it add a whole bunch of pointer derefs and arithmetic (and a
probably unnecessary second indirection for page->flags), it also brings a
read of contig_page_data[] into the picture.


So...  it's not obvious to me that this is an aggregate improvement?

--
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-18 23:15 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-18 19:21 Christoph Lameter
2006-09-18 20:28 ` Andrew Morton
2006-09-18 22:51   ` Christoph Lameter
2006-09-18 23:15     ` Andrew Morton [this message]
2006-09-18 23:46       ` Christoph Lameter
2006-09-18 23:58         ` Andrew Morton
2006-09-19  0:08           ` Christoph Lameter
2006-09-19  0:14           ` Christoph Lameter
2006-09-19  0:31             ` Andrew Morton
2006-09-19  1:20               ` Christoph Lameter
2006-09-19  6:12               ` Christoph Lameter
2006-09-19  6:33                 ` Andrew Morton
2006-09-19 14:10                   ` Christoph Lameter
2006-09-19 15:38                     ` Andrew Morton
2006-09-19 15:41                       ` Christoph Lameter
2006-09-19 16:23                         ` Nick Piggin
2006-09-19 16:45                           ` Nick Piggin
2006-09-19 17:50                             ` Christoph Lameter
2006-09-19 18:24                               ` Andi Kleen
2006-09-19 16:17                       ` Nick Piggin
2006-09-24 10:06 ` Andrew Morton
2006-09-24 16:58   ` Christoph Lameter
2006-09-27  9:19   ` Andrew Morton
2006-09-27  9:26     ` Andy Whitcroft
2006-09-27 11:23     ` [PATCH] zone table removal miss merge Andy Whitcroft
2006-09-27 16:19       ` Christoph Lameter
2006-09-27 11:27     ` [PATCH] Get rid of zone_table V2 Andy Whitcroft
2006-09-27 16:24       ` Andrew Morton
2006-09-30 18:47       ` Christoph Lameter
2006-09-30 18:48         ` Christoph Lameter
2006-09-30 20:08         ` Andrew Morton
2006-10-02 15:57           ` Christoph Lameter
2006-10-02 17:10           ` Christoph Lameter
2006-10-04 10:10             ` Andy Whitcroft
2006-10-06 14:45             ` [PATCH] zoneid fix up calculations for ZONEID_PGSHIFT Andy Whitcroft
2006-10-06 17:00               ` Christoph Lameter

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=20060918161528.9714c30c.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=apw@shadowen.org \
    --cc=clameter@sgi.com \
    --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