Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932471AbXILW2U (ORCPT ); Wed, 12 Sep 2007 18:28:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756454AbXILW2M (ORCPT ); Wed, 12 Sep 2007 18:28:12 -0400 Received: from netops-testserver-3-out.sgi.com ([192.48.171.28]:38420 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753526AbXILW2L (ORCPT ); Wed, 12 Sep 2007 18:28:11 -0400 Date: Wed, 12 Sep 2007 15:28:10 -0700 (PDT) From: Christoph Lameter X-X-Sender: clameter@schroedinger.engr.sgi.com To: Mathieu Desnoyers cc: Peter Zijlstra , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, mingo@redhat.com, linux-ia64@vger.kernel.org Subject: Re: [PATCH] slub - Use local_t protection In-Reply-To: <20070905130612.GC11880@Krystal> Message-ID: References: <20070827203913.GA7416@Krystal> <20070827211003.GA10627@Krystal> <20070827213845.GB9748@Krystal> <20070827222715.GA16982@Krystal> <20070904200429.GD8157@Krystal> <20070905130612.GC11880@Krystal> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1679 Lines: 55 On Wed, 5 Sep 2007, Mathieu Desnoyers wrote: > Use local_enter/local_exit for protection in the fast path. Sorry that it took some time to get back to this issue. KS interfered. > @@ -1494,8 +1487,16 @@ new_slab: > c->page = new; > goto load_freelist; > } > - > + if (gfpflags & __GFP_WAIT) { > + local_nest_irq_enable(); > + local_exit(); > + } > new = new_slab(s, gfpflags, node); > + if (gfpflags & __GFP_WAIT) { > + local_enter(); > + local_nest_irq_disable(); > + } > + > if (new) { > c = get_cpu_slab(s, smp_processor_id()); > if (c->page) { Hmmmm... Definitely an interesting change to move the interrupt enable/disable to __slab_alloc. But it looks like it is getting a bit messy. All my attempts ended also like this. Sigh. > @@ -2026,8 +2032,11 @@ static struct kmem_cache_node *early_kme > > BUG_ON(kmalloc_caches->size < sizeof(struct kmem_cache_node)); > > + if (gfpflags & __GFP_WAIT) > + local_irq_enable(); > page = new_slab(kmalloc_caches, gfpflags, node); > - > + if (gfpflags & __GFP_WAIT) > + local_irq_disable(); > BUG_ON(!page); > if (page_to_nid(page) != node) { > printk(KERN_ERR "SLUB: Unable to allocate memory from " Hmmmm... Actually we could drop the irq disable / enable here since this is boot code. That would also allow the removal of the later local_irq_enable. Good idea. I think I will do the moving of the interrupt enable/disable independently. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/