lkml.org 
[lkml]   [2014]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [PATCH 1/3] memblock, nobootmem: Add memblock_virt_alloc_low()
From
On Tue, Jan 28, 2014 at 11:55 AM, Yinghai Lu <yinghai@kernel.org> wrote:

> but looks like memblock_virt_alloc_low is not the same as alloc_bootmem_low yet.
>

The memblock_virt_alloc missed limit checking.

Please check attached patch.

Thanks

Yinghai
Subject: [PATCH] memblock: Add limit checking to memblock_virt_alloc

In original bootmem wrapper for memblock, we have limit checking.

Add it to memblock_virt_alloc, to address arm and x86 booting crash.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
mm/memblock.c | 3 +++
1 file changed, 3 insertions(+)

Index: linux-2.6/mm/memblock.c
===================================================================
--- linux-2.6.orig/mm/memblock.c
+++ linux-2.6/mm/memblock.c
@@ -1077,6 +1077,9 @@ static void * __init memblock_virt_alloc
if (!align)
align = SMP_CACHE_BYTES;

+ if (max_addr > memblock.current_limit)
+ max_addr = memblock.current_limit;
+
again:
alloc = memblock_find_in_range_node(size, align, min_addr, max_addr,
nid);
\
 
 \ /
  Last update: 2014-01-28 21:41    [W:0.039 / U:0.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site