lkml.org 
[lkml]   [2008]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH -mm 12/14] bootmem: Make __alloc_bootmem_low_node fall back to other nodes
__alloc_bootmem_node already does this, make the interface consistent.

Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
CC: Ingo Molnar <mingo@elte.hu>
CC: Yinghai Lu <yhlu.kernel@gmail.com>
CC: Andi Kleen <andi@firstfloor.org>
---

mm/bootmem.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)

--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -595,6 +595,19 @@ void * __init __alloc_bootmem_low(unsign
return ___alloc_bootmem(size, align, goal, ARCH_LOW_ADDRESS_LIMIT);
}

+static void * __init ___alloc_bootmem_node(bootmem_data_t *bdata,
+ unsigned long size, unsigned long align,
+ unsigned long goal, unsigned long limit)
+{
+ void *ptr;
+
+ ptr = alloc_bootmem_core(bdata, size, align, goal, limit);
+ if (ptr)
+ return ptr;
+
+ return ___alloc_bootmem(size, align, goal, limit);
+}
+
/**
* __alloc_bootmem_node - allocate boot memory from a specific node
* @pgdat: node to allocate from
@@ -613,13 +626,7 @@ void * __init __alloc_bootmem_low(unsign
void * __init __alloc_bootmem_node(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(size, align, goal);
+ return ___alloc_bootmem_node(pgdat->bdata, size, align, goal, 0);
}

/**
@@ -640,8 +647,8 @@ void * __init __alloc_bootmem_node(pg_da
void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size,
unsigned long align, unsigned long goal)
{
- return alloc_bootmem_core(pgdat->bdata, size, align, goal,
- ARCH_LOW_ADDRESS_LIMIT);
+ return ___alloc_bootmem_node(pgdat->bdata, size, align,
+ goal, ARCH_LOW_ADDRESS_LIMIT);
}

#ifdef CONFIG_SPARSEMEM
--



\
 
 \ /
  Last update: 2008-05-30 22:09    [W:0.102 / U:0.256 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site