mm: Add alloc_bootmem_low_pages_nopanic()
authorYinghai Lu <yinghai@kernel.org>
Thu, 24 Jan 2013 20:20:15 +0000 (12:20 -0800)
committerH. Peter Anvin <hpa@linux.intel.com>
Wed, 30 Jan 2013 03:32:59 +0000 (19:32 -0800)
We don't need to panic in some case, like for swiotlb preallocating.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/1359058816-7615-35-git-send-email-yinghai@kernel.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
include/linux/bootmem.h
mm/bootmem.c
mm/nobootmem.c

index 3f778c27f8259aa91452fa85895890bcc7007f4f..3cd16ba82f15119701ebd477320304d714aba971 100644 (file)
@@ -99,6 +99,9 @@ void *___alloc_bootmem_node_nopanic(pg_data_t *pgdat,
 extern void *__alloc_bootmem_low(unsigned long size,
                                 unsigned long align,
                                 unsigned long goal);
+void *__alloc_bootmem_low_nopanic(unsigned long size,
+                                unsigned long align,
+                                unsigned long goal);
 extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
                                      unsigned long size,
                                      unsigned long align,
@@ -132,6 +135,8 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
 
 #define alloc_bootmem_low(x) \
        __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0)
+#define alloc_bootmem_low_pages_nopanic(x) \
+       __alloc_bootmem_low_nopanic(x, PAGE_SIZE, 0)
 #define alloc_bootmem_low_pages(x) \
        __alloc_bootmem_low(x, PAGE_SIZE, 0)
 #define alloc_bootmem_low_pages_node(pgdat, x) \
index b93376c39b61308fe2ef7de2466e83306c865cf9..2b0bcb019ec222b8d56be811866e421a6287f13b 100644 (file)
@@ -833,6 +833,14 @@ void * __init __alloc_bootmem_low(unsigned long size, unsigned long align,
        return ___alloc_bootmem(size, align, goal, ARCH_LOW_ADDRESS_LIMIT);
 }
 
+void * __init __alloc_bootmem_low_nopanic(unsigned long size,
+                                         unsigned long align,
+                                         unsigned long goal)
+{
+       return ___alloc_bootmem_nopanic(size, align, goal,
+                                       ARCH_LOW_ADDRESS_LIMIT);
+}
+
 /**
  * __alloc_bootmem_low_node - allocate low boot memory from a specific node
  * @pgdat: node to allocate from
index 03d152a76acf5e18396b74e62a3372e55b469750..5e07d36e381e6a568bd4770ce4c5079d1547ee56 100644 (file)
@@ -391,6 +391,14 @@ void * __init __alloc_bootmem_low(unsigned long size, unsigned long align,
        return ___alloc_bootmem(size, align, goal, ARCH_LOW_ADDRESS_LIMIT);
 }
 
+void * __init __alloc_bootmem_low_nopanic(unsigned long size,
+                                         unsigned long align,
+                                         unsigned long goal)
+{
+       return ___alloc_bootmem_nopanic(size, align, goal,
+                                       ARCH_LOW_ADDRESS_LIMIT);
+}
+
 /**
  * __alloc_bootmem_low_node - allocate low boot memory from a specific node
  * @pgdat: node to allocate from