mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: Christoph Lameter <christoph@lameter.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	Pekka J Enberg <penberg@cs.helsinki.fi>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] NUMA : could we introduce virt_to_nid() ?
Date: Fri, 23 Mar 2007 17:22:12 +0100	[thread overview]
Message-ID: <20070323172212.6648412d.dada1@cosmosbay.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0703230749130.29603@graphe.net>

On Fri, 23 Mar 2007 07:50:28 -0700 (PDT)
Christoph Lameter <christoph@lameter.com> wrote:

> On Fri, 23 Mar 2007, Eric Dumazet wrote:
> 
> > Checking Christoph quicklist implementation, I found the same cache miss in free() than SLAB has.
> > 
> > /* common implementation *
> > int virt_to_nid(const void *addr)
> > {
> > 	struct page *page = virt_to_page(addr); 
> > 	return page_to_nid(page);
> > }
> > 
> > On some platforms (x86_64 for example), could we have a better 
> > implementation, not accessing struct page, but using phys_to_nid() ?
> 
> This is going to pollute the caches since we then use multiple ways to 
> determine the node of a page. Its better to stay with the same approach 
> for all pages. The page struct is used for many other purposes as well. 
> Its likely to be in the cpu cache.
> 

Sorry ? page structs are not in cpu cache at all.

phys_to_nid() on my 16 GB x86_64 machine uses one single cache line, shared by all pages.
This single cache line is cache hot yes, not "struct page"s ...

And on this machine, thats about 224 Mbytes of 'struct pages'

You carefully commented your alloc() function saying it is touching two cache lines.
But you omited to say that free() function needs 3 cache lines if CONFIG_NUMA

For SLAB use, page struct is needed because we use lru.{next|prev} to store slab/cachep pointers, but for a pure page allocator, unless I misread your patch, we dont need it, if virt_to_nid() can do its job without it.


  reply	other threads:[~2007-03-23 16:22 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-21  9:22 [RFC, PATCH] SLAB : [NUMA] keep nodeid in struct page instead of struct slab Eric Dumazet
2007-03-21 12:21 ` Pekka Enberg
2007-03-21 14:42   ` Christoph Lameter
2007-03-21 15:03     ` Pekka Enberg
2007-03-21 15:43       ` Christoph Lameter
2007-03-21 15:42     ` Pekka J Enberg
2007-03-21 15:49       ` Eric Dumazet
2007-03-21 15:55         ` Pekka J Enberg
2007-03-21 16:09       ` Andi Kleen
2007-03-21 16:19         ` Pekka Enberg
2007-03-21 16:27         ` Christoph Lameter
2007-03-23 11:15         ` [RFC] NUMA : could we introduce virt_to_nid() ? Eric Dumazet
2007-03-23 12:48           ` Pekka Enberg
2007-03-23 13:53             ` Eric Dumazet
2007-03-23 14:16           ` Andi Kleen
2007-03-23 14:50           ` Christoph Lameter
2007-03-23 16:22             ` Eric Dumazet [this message]
2007-03-23 17:19               ` Christoph Lameter
2007-03-21 12:27 ` [RFC, PATCH] SLAB : [NUMA] keep nodeid in struct page instead of struct slab Pekka Enberg
2007-03-21 14:41 ` Christoph Lameter
2007-03-21 15:36   ` Eric Dumazet
2007-03-21 15:44     ` Christoph Lameter
2007-03-21 15:58       ` Eric Dumazet
2007-03-21 15:47     ` Pekka Enberg
2007-03-21 15:52       ` Eric Dumazet
2007-03-21 16:08 ` Andi Kleen

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=20070323172212.6648412d.dada1@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=christoph@lameter.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    /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®