]> err.no Git - linux-2.6/commitdiff
mm: introduce non panic alloc_bootmem
authorAndi Kleen <ak@suse.de>
Thu, 24 Jul 2008 04:27:45 +0000 (21:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Jul 2008 17:47:17 +0000 (10:47 -0700)
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>
include/linux/bootmem.h
mm/bootmem.c

index dd8fee6c46d924f11258accae6c0d07f4b9ae571..f352c5f125b40cb9902099e0037cb5bcef997168 100644 (file)
@@ -89,6 +89,10 @@ extern void *__alloc_bootmem_node(pg_data_t *pgdat,
                                  unsigned long size,
                                  unsigned long align,
                                  unsigned long goal);
+extern void *__alloc_bootmem_node_nopanic(pg_data_t *pgdat,
+                                 unsigned long size,
+                                 unsigned long align,
+                                 unsigned long goal);
 extern unsigned long init_bootmem_node(pg_data_t *pgdat,
                                       unsigned long freepfn,
                                       unsigned long startpfn,
index 4bc6ae2fbaa362ae55d59c778bfe7ee5cf1fe5b9..9ac972535fff4956bf10edb98118fc3b8b375bc8 100644 (file)
@@ -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