aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2006-04-07 13:49:21 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-09 14:53:16 -0400
commita8062231d80239cf3405982858c02aea21a6066a (patch)
tree0576493fa99cda91069fe3b67c19bd024858e69e /mm
parent68a3a7feb08f960095072f28ec20f7900793c506 (diff)
[PATCH] x86_64: Handle empty PXMs that only contain hotplug memory
The node setup code would try to allocate the node metadata in the node itself, but that fails if there is no memory in there. This can happen with memory hotplug when the hotplug area defines an so far empty node. Now use bootmem to try to allocate the mem_map in other nodes. And if it fails don't panic, but just ignore the node. To make this work I added a new __alloc_bootmem_nopanic function that does what its name implies. TBD should try to use nearby nodes here. Currently we just use any. It's hard to do it better because bootmem doesn't have proper fallback lists yet. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/bootmem.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/mm/bootmem.c b/mm/bootmem.c
index d3e3bd2ffce..d213feded10 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -401,7 +401,7 @@ unsigned long __init free_all_bootmem (void)
401 return(free_all_bootmem_core(NODE_DATA(0))); 401 return(free_all_bootmem_core(NODE_DATA(0)));
402} 402}
403 403
404void * __init __alloc_bootmem(unsigned long size, unsigned long align, unsigned long goal) 404void * __init __alloc_bootmem_nopanic(unsigned long size, unsigned long align, unsigned long goal)
405{ 405{
406 bootmem_data_t *bdata; 406 bootmem_data_t *bdata;
407 void *ptr; 407 void *ptr;
@@ -409,7 +409,14 @@ void * __init __alloc_bootmem(unsigned long size, unsigned long align, unsigned
409 list_for_each_entry(bdata, &bdata_list, list) 409 list_for_each_entry(bdata, &bdata_list, list)
410 if ((ptr = __alloc_bootmem_core(bdata, size, align, goal, 0))) 410 if ((ptr = __alloc_bootmem_core(bdata, size, align, goal, 0)))
411 return(ptr); 411 return(ptr);
412 return NULL;
413}
412 414
415void * __init __alloc_bootmem(unsigned long size, unsigned long align, unsigned long goal)
416{
417 void *mem = __alloc_bootmem_nopanic(size,align,goal);
418 if (mem)
419 return mem;
413 /* 420 /*
414 * Whoops, we cannot satisfy the allocation request. 421 * Whoops, we cannot satisfy the allocation request.
415 */ 422 */