Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754151AbYAWOck (ORCPT ); Wed, 23 Jan 2008 09:32:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751942AbYAWOcc (ORCPT ); Wed, 23 Jan 2008 09:32:32 -0500 Received: from courier.cs.helsinki.fi ([128.214.9.1]:52693 "EHLO mail.cs.helsinki.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752080AbYAWOcc (ORCPT ); Wed, 23 Jan 2008 09:32:32 -0500 Date: Wed, 23 Jan 2008 16:32:30 +0200 (EET) From: Pekka J Enberg To: Mel Gorman cc: akpm@linux-foundation.org, Christoph Lameter , linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org, "Aneesh Kumar K.V" , hanth Aravamudan , KAMEZAWA Hiroyuki , lee.schermerhorn@hp.com, Linux MM , Olaf Hering Subject: Re: [PATCH] Fix boot problem in situations where the boot CPU is running on a memoryless node In-Reply-To: Message-ID: References: <20080118213011.GC10491@csn.ul.ie> <20080118225713.GA31128@aepfle.de> <20080122195448.GA15567@csn.ul.ie> <20080122214505.GA15674@aepfle.de> <20080123075821.GA17713@aepfle.de> <20080123105044.GD21455@csn.ul.ie> <20080123121459.GA18631@aepfle.de> <20080123125236.GA18876@aepfle.de> <20080123135513.GA14175@csn.ul.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2045 Lines: 68 On Wed, 23 Jan 2008, Pekka J Enberg wrote: > I still think Christoph's kmem_getpages() patch is correct (to fix > cache_grow() oops) but I overlooked the fact that none the callers of > ____cache_alloc_node() deal with bootstrapping (with the exception of > __cache_alloc_node() that even has a comment about it). So something like this (totally untested) patch on top of current git: --- mm/slab.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) Index: linux-2.6/mm/slab.c =================================================================== --- linux-2.6.orig/mm/slab.c +++ linux-2.6/mm/slab.c @@ -1668,7 +1668,11 @@ static void *kmem_getpages(struct kmem_c if (cachep->flags & SLAB_RECLAIM_ACCOUNT) flags |= __GFP_RECLAIMABLE; - page = alloc_pages_node(nodeid, flags, cachep->gfporder); + if (nodeid == -1) + page = alloc_pages(flags, cachep->gfporder); + else + page = alloc_pages_node(nodeid, flags, cachep->gfporder); + if (!page) return NULL; @@ -2976,8 +2980,9 @@ retry: batchcount = BATCHREFILL_LIMIT; } l3 = cachep->nodelists[node]; + if (!l3) + return NULL; - BUG_ON(ac->avail > 0 || !l3); spin_lock(&l3->list_lock); /* See if we can refill from the shared array */ @@ -3317,7 +3322,8 @@ static void *____cache_alloc_node(struct int x; l3 = cachep->nodelists[nodeid]; - BUG_ON(!l3); + if (!l3) + return fallback_alloc(cachep, flags); retry: check_irq_off(); @@ -3394,12 +3400,6 @@ __cache_alloc_node(struct kmem_cache *ca if (unlikely(nodeid == -1)) nodeid = numa_node_id(); - if (unlikely(!cachep->nodelists[nodeid])) { - /* Node not bootstrapped yet */ - ptr = fallback_alloc(cachep, flags); - goto out; - } - if (nodeid == numa_node_id()) { /* * Use the locally cached objects if possible. -- 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/