[PATCH 26/49] memblock: Make memblock_alloc_try_nid() fallback to MEMBLOCK_ALLOC_ANYWHERE

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Yinghai Lu
Date: Monday, July 19, 2010 - 4:56 pm

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>

memblock_alloc_nid() used to fallback to allocating anywhere by using
memblock_alloc() as a fallback.

However, some of my previous patches limit memblock_alloc() to the region
covered by MEMBLOCK_ALLOC_ACCESSIBLE which is not quite what we want
for memblock_alloc_try_nid().

So we fix it by explicitely using MEMBLOCK_ALLOC_ANYWHERE.

Not that so far only sparc uses memblock_alloc_nid() and it hasn't been updated
to clamp the accessible zone yet. Thus the temporary "breakage" should have
no effect.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 mm/memblock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index c3c499e..424ca11 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -546,7 +546,7 @@ phys_addr_t __init memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, i
 
 	if (res)
 		return res;
-	return memblock_alloc(size, align);
+	return memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ANYWHERE);
 }
 
 
-- 
1.6.4.2

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH -v25 00/49] Use memblock with x86, Yinghai Lu, (Mon Jul 19, 4:56 pm)
[PATCH 02/49] x86,mm: fix 32bit numa sparsemem, Yinghai Lu, (Mon Jul 19, 4:56 pm)
[PATCH 26/49] memblock: Make memblock_alloc_try_nid() fall ..., Yinghai Lu, (Mon Jul 19, 4:56 pm)
[PATCH 33/49] memblock: Add memblock_find_in_range(), Yinghai Lu, (Mon Jul 19, 4:56 pm)
[PATCH 40/49] memblock: Add find_memory_core_early(), Yinghai Lu, (Mon Jul 19, 4:56 pm)
[PATCH 45/49] x86: Use memblock to replace early_res, Yinghai Lu, (Mon Jul 19, 4:56 pm)
[PATCH 47/49] x86: Remove not used early_res code, Yinghai Lu, (Mon Jul 19, 4:56 pm)
[PATCH 49/49] x86: remove old bootmem code, Yinghai Lu, (Mon Jul 19, 4:56 pm)
Re: [PATCH -v25 00/49] Use memblock with x86, Linus Torvalds, (Mon Jul 19, 5:14 pm)
Re: [PATCH -v25 00/49] Use memblock with x86, Yinghai Lu, (Mon Jul 19, 5:35 pm)
Re: [PATCH -v25 00/49] Use memblock with x86, H. Peter Anvin, (Tue Jul 20, 11:29 am)