Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932106AbVKVG5S (ORCPT ); Tue, 22 Nov 2005 01:57:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932139AbVKVG5R (ORCPT ); Tue, 22 Nov 2005 01:57:17 -0500 Received: from courier.cs.helsinki.fi ([128.214.9.1]:2196 "EHLO mail.cs.helsinki.fi") by vger.kernel.org with ESMTP id S932106AbVKVG5R (ORCPT ); Tue, 22 Nov 2005 01:57:17 -0500 Date: Tue, 22 Nov 2005 08:57:13 +0200 (EET) From: Pekka J Enberg To: Christoph Lameter cc: akpm@osdl.org, linux-kernel@vger.kernel.org, manfred@colorfullife.com, Joe Perches Subject: Re: [PATCH] slab: minor cleanup to kmem_cache_alloc_node In-Reply-To: Message-ID: References: <1132598194.8972.4.camel@localhost> <1132607272.19332.7.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1626 Lines: 44 On Mon, 21 Nov 2005, Christoph Lameter wrote: > If we drop the printk then this may be even simpler > > Signed-off-by: Christoph Lameter Even better. Thanks! Acked-by: Pekka Enberg > Index: linux-2.6.15-rc1-mm2/mm/slab.c > =================================================================== > --- linux-2.6.15-rc1-mm2.orig/mm/slab.c 2005-11-21 13:16:07.000000000 -0800 > +++ linux-2.6.15-rc1-mm2/mm/slab.c 2005-11-21 13:16:59.000000000 -0800 > @@ -2890,21 +2890,14 @@ void *kmem_cache_alloc_node(kmem_cache_t > unsigned long save_flags; > void *ptr; > > - if (nodeid == -1) > - return __cache_alloc(cachep, flags); > - > - if (unlikely(!cachep->nodelists[nodeid])) { > - /* Fall back to __cache_alloc if we run into trouble */ > - printk(KERN_WARNING "slab: not allocating in inactive node %d for cache %s\n", nodeid, cachep->name); > - return __cache_alloc(cachep,flags); > - } > - > cache_alloc_debugcheck_before(cachep, flags); > local_irq_save(save_flags); > - if (nodeid == numa_node_id()) > + > + if (nodeid == -1 || nodeid == numa_node_id() || !cachep->nodelists[nodeid]) > ptr = ____cache_alloc(cachep, flags); > else > ptr = __cache_alloc_node(cachep, flags, nodeid); > + > local_irq_restore(save_flags); > ptr = cache_alloc_debugcheck_after(cachep, flags, ptr, __builtin_return_address(0)); > > - 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/