From e2dcfb355e776f2bd2bd64b3e04cd1dd8d668aa9 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Sat, 26 Jun 2004 20:53:37 -0700 Subject: [PATCH] __alloc_bootmem_node should not panic when it fails __alloc_bootmem_node currently panics if it cant satisfy an allocation for a particular node. Thats rather antisocial, we should at the very least return NULL and allow the caller to proceed (eg try another node). A quick look at alloc_bootmem_node usage suggests we should fall back to allocating from other nodes if it fails (as arch/alpha/kernel/pci_iommu.c and arch/x86_64/kernel/setup64.c do). The following patch does that. We fall back to the regular __alloc_bootmem when __alloc_bootmem_node fails, which means all other nodes are checked for available memory. Signed-off-by: Anton Blanchard Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/bootmem.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mm/bootmem.c b/mm/bootmem.c index 052dfeac0769..00f4661e174b 100644 --- a/mm/bootmem.c +++ b/mm/bootmem.c @@ -371,11 +371,6 @@ void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsign if (ptr) return (ptr); - /* - * Whoops, we cannot satisfy the allocation request. - */ - printk(KERN_ALERT "bootmem alloc of %lu bytes failed!\n", size); - panic("Out of memory"); - return NULL; + return __alloc_bootmem(size, align, goal); } -- cgit v1.2.3