diff options
author | Andi Kleen <ak@suse.de> | 2008-07-24 06:27:45 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 19:47:17 +0200 |
commit | b54bbf7b81170f03597c17dd0b559e3006bc9868 (patch) | |
tree | abc6b326e293d3a685d943956d32ab4038a90e1f /mm/bootmem.c | |
parent | hugetlb: abstract numa round robin selection (diff) | |
download | linux-b54bbf7b81170f03597c17dd0b559e3006bc9868.tar.xz linux-b54bbf7b81170f03597c17dd0b559e3006bc9868.zip |
mm: introduce non panic alloc_bootmem
Straight forward variant of the existing __alloc_bootmem_node, only
subsequent patch when allocating giant hugepages at boot -- don't want to
panic if we can't allocate as many as the user asked for.
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/bootmem.c')
-rw-r--r-- | mm/bootmem.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mm/bootmem.c b/mm/bootmem.c index 4bc6ae2fbaa3..9ac972535fff 100644 --- a/mm/bootmem.c +++ b/mm/bootmem.c @@ -578,6 +578,18 @@ void * __init alloc_bootmem_section(unsigned long size, } #endif +void * __init __alloc_bootmem_node_nopanic(pg_data_t *pgdat, unsigned long size, + unsigned long align, unsigned long goal) +{ + void *ptr; + + ptr = alloc_bootmem_core(pgdat->bdata, size, align, goal, 0); + if (ptr) + return ptr; + + return __alloc_bootmem_nopanic(size, align, goal); +} + #ifndef ARCH_LOW_ADDRESS_LIMIT #define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL #endif |