public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Christoph Lameter <clameter@sgi.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [patch 4/6] SLUB: Avoid touching page struct when freeing to per cpu slab
Date: Thu, 23 Aug 2007 17:05:58 +0200	[thread overview]
Message-ID: <1187881558.6114.400.camel@twins> (raw)
In-Reply-To: <20070823064734.558994491@sgi.com>

On Wed, 2007-08-22 at 23:46 -0700, Christoph Lameter wrote:
> plain text document attachment
> (0008-SLUB-Avoid-touching-page-struct-when-freeing-to-per.patch)
> Set c->node to -1 if we allocate from a debug slab instead for SlabDebug
> which requires access the page struct cacheline.

this relies on node_match() which will only ever return !1 when
CONFIG_NUMA

> Signed-off-by: Christoph Lameter <clameter@sgi.com>
> ---
>  mm/slub.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> Index: linux-2.6.23-rc3-mm1/mm/slub.c
> ===================================================================
> --- linux-2.6.23-rc3-mm1.orig/mm/slub.c	2007-08-22 17:20:28.000000000 -0700
> +++ linux-2.6.23-rc3-mm1/mm/slub.c	2007-08-22 17:20:33.000000000 -0700
> @@ -1517,6 +1517,7 @@ debug:
>  
>  	c->page->inuse++;
>  	c->page->freelist = object[c->offset];
> +	c->node = -1;
>  	slab_unlock(c->page);
>  	return object;
>  }
> @@ -1540,8 +1541,7 @@ static void __always_inline *slab_alloc(
>  
>  	local_irq_save(flags);
>  	c = get_cpu_slab(s, smp_processor_id());
> -	if (unlikely(!c->page || !c->freelist ||
> -					!node_match(c, node)))
> +	if (unlikely(!c->freelist || !node_match(c, node)))
>  
>  		object = __slab_alloc(s, gfpflags, node, addr, c);
>  
> @@ -1650,7 +1650,7 @@ static void __always_inline slab_free(st
>  	local_irq_save(flags);
>  	debug_check_no_locks_freed(object, s->objsize);
>  	c = get_cpu_slab(s, smp_processor_id());
> -	if (likely(page == c->page && !SlabDebug(page))) {
> +	if (likely(page == c->page && c->node >= 0)) {
>  		object[c->offset] = c->freelist;
>  		c->freelist = object;
>  	} else
> 


  reply	other threads:[~2007-08-23 15:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-23  6:46 [patch 0/6] Per cpu structures for SLUB Christoph Lameter
2007-08-23  6:46 ` [patch 1/6] SLUB: Avoid page struct cacheline bouncing due to remote frees to cpu slab Christoph Lameter
2007-08-23  6:46 ` [patch 2/6] SLUB: Do not use page->mapping Christoph Lameter
2007-08-23  6:46 ` [patch 3/6] SLUB: Move page->offset to kmem_cache_cpu->offset Christoph Lameter
2007-08-23  6:46 ` [patch 4/6] SLUB: Avoid touching page struct when freeing to per cpu slab Christoph Lameter
2007-08-23 15:05   ` Peter Zijlstra [this message]
2007-08-23 19:30     ` Christoph Lameter
2007-08-24 16:46       ` Christoph Lameter
2007-08-23  6:46 ` [patch 5/6] SLUB: Place kmem_cache_cpu structures in a NUMA aware way Christoph Lameter
2007-08-23  6:46 ` [patch 6/6] SLUB: Optimize cacheline use for zeroing Christoph Lameter
2007-08-23  9:52 ` [patch 0/6] Per cpu structures for SLUB Peter Zijlstra
2007-08-23 19:25   ` Christoph Lameter
2007-08-24 21:38 ` Andrew Morton
2007-08-27 18:50   ` Christoph Lameter
2007-08-27 23:51     ` Andrew Morton

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=1187881558.6114.400.camel@twins \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.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