diff options
Diffstat (limited to 'mm/bootmem.c')
-rw-r--r-- | mm/bootmem.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/mm/bootmem.c b/mm/bootmem.c index 58c66cc5056a..142c84a54993 100644 --- a/mm/bootmem.c +++ b/mm/bootmem.c | |||
@@ -833,15 +833,24 @@ static void * __init ___alloc_bootmem_node(bootmem_data_t *bdata, | |||
833 | void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, | 833 | void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, |
834 | unsigned long align, unsigned long goal) | 834 | unsigned long align, unsigned long goal) |
835 | { | 835 | { |
836 | void *ptr; | ||
837 | |||
836 | if (WARN_ON_ONCE(slab_is_available())) | 838 | if (WARN_ON_ONCE(slab_is_available())) |
837 | return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); | 839 | return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); |
838 | 840 | ||
839 | #ifdef CONFIG_NO_BOOTMEM | 841 | #ifdef CONFIG_NO_BOOTMEM |
840 | return __alloc_memory_core_early(pgdat->node_id, size, align, | 842 | ptr = __alloc_memory_core_early(pgdat->node_id, size, align, |
843 | goal, -1ULL); | ||
844 | if (ptr) | ||
845 | return ptr; | ||
846 | |||
847 | ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align, | ||
841 | goal, -1ULL); | 848 | goal, -1ULL); |
842 | #else | 849 | #else |
843 | return ___alloc_bootmem_node(pgdat->bdata, size, align, goal, 0); | 850 | ptr = ___alloc_bootmem_node(pgdat->bdata, size, align, goal, 0); |
844 | #endif | 851 | #endif |
852 | |||
853 | return ptr; | ||
845 | } | 854 | } |
846 | 855 | ||
847 | void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size, | 856 | void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size, |
@@ -977,14 +986,21 @@ void * __init __alloc_bootmem_low(unsigned long size, unsigned long align, | |||
977 | void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size, | 986 | void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size, |
978 | unsigned long align, unsigned long goal) | 987 | unsigned long align, unsigned long goal) |
979 | { | 988 | { |
989 | void *ptr; | ||
990 | |||
980 | if (WARN_ON_ONCE(slab_is_available())) | 991 | if (WARN_ON_ONCE(slab_is_available())) |
981 | return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); | 992 | return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); |
982 | 993 | ||
983 | #ifdef CONFIG_NO_BOOTMEM | 994 | #ifdef CONFIG_NO_BOOTMEM |
984 | return __alloc_memory_core_early(pgdat->node_id, size, align, | 995 | ptr = __alloc_memory_core_early(pgdat->node_id, size, align, |
996 | goal, ARCH_LOW_ADDRESS_LIMIT); | ||
997 | if (ptr) | ||
998 | return ptr; | ||
999 | ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align, | ||
985 | goal, ARCH_LOW_ADDRESS_LIMIT); | 1000 | goal, ARCH_LOW_ADDRESS_LIMIT); |
986 | #else | 1001 | #else |
987 | return ___alloc_bootmem_node(pgdat->bdata, size, align, | 1002 | ptr = ___alloc_bootmem_node(pgdat->bdata, size, align, |
988 | goal, ARCH_LOW_ADDRESS_LIMIT); | 1003 | goal, ARCH_LOW_ADDRESS_LIMIT); |
989 | #endif | 1004 | #endif |
1005 | return ptr; | ||
990 | } | 1006 | } |