Commit 2c478eae authored by Johannes Weiner's avatar Johannes Weiner Committed by Linus Torvalds

mm: nobootmem: panic on node-specific allocation failure

__alloc_bootmem_node and __alloc_bootmem_low_node documentation claims
the functions panic on allocation failure.  Do it.
Signed-off-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
Acked-by: default avatarYinghai Lu <yinghai@kernel.org>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Cc: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 421456ed
...@@ -305,11 +305,17 @@ void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, ...@@ -305,11 +305,17 @@ void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size,
ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align, ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align,
goal, -1ULL); goal, -1ULL);
if (!ptr && goal) { if (ptr)
return ptr;
if (goal) {
goal = 0; goal = 0;
goto again; goto again;
} }
return ptr;
printk(KERN_ALERT "bootmem alloc of %lu bytes failed!\n", size);
panic("Out of memory");
return NULL;
} }
void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size, void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size,
...@@ -407,6 +413,12 @@ void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size, ...@@ -407,6 +413,12 @@ void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size,
if (ptr) if (ptr)
return ptr; return ptr;
return __alloc_memory_core_early(MAX_NUMNODES, size, align, ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align,
goal, ARCH_LOW_ADDRESS_LIMIT); goal, ARCH_LOW_ADDRESS_LIMIT);
if (ptr)
return ptr;
printk(KERN_ALERT "bootmem alloc of %lu bytes failed!\n", size);
panic("Out of memory");
return NULL;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment