lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Wed, 23 Jan 2008 16:32:30 +0200 (EET) From: Pekka J Enberg <penberg@...helsinki.fi> To: Mel Gorman <mel@....ul.ie> cc: akpm@...ux-foundation.org, Christoph Lameter <clameter@....com>, linux-kernel@...r.kernel.org, linuxppc-dev@...abs.org, "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>, hanth Aravamudan <nacc@...ibm.com>, KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>, lee.schermerhorn@...com, Linux MM <linux-mm@...ck.org>, Olaf Hering <olaf@...fle.de> Subject: Re: [PATCH] Fix boot problem in situations where the boot CPU is running on a memoryless node 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@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists