lkml.org 
[lkml]   [2008]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Fix new alloc_bootmem_core (Re: [PATCH -mm 08/14] bootmem: clean up alloc_bootmem_core)
Hi Johannes-san.

I found a bug in this patch.


> - eidx = end_pfn - PFN_DOWN(node_boot_start);
> + if (goal && goal < max)
> + start = ALIGN(goal, step);
> + else
> + start = ALIGN(min, step);

Here should check (min < goal) too.

If not, start can becomes smaller than min. and sidx doesn't point
correct index.
alloc_bootmem_node() almost allocates pages of other node,
when node's min address is over MAX_DMA_ADDRESS.

Bye.

----

Fix new alloc_bootmem_core() of bootmem-clean-up-alloc_bootmem_core.patch
in 2.6.26-rc5-mm3.

(min < goal) should be checked too.


Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
CC: Johannes Weiner <hannes@saeurebad.de>

---
mm/bootmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: current/mm/bootmem.c
===================================================================
--- current.orig/mm/bootmem.c 2008-06-17 18:33:31.000000000 +0900
+++ current/mm/bootmem.c 2008-06-17 18:34:27.000000000 +0900
@@ -435,7 +435,7 @@

step = max(align >> PAGE_SHIFT, 1UL);

- if (goal && goal < max)
+ if (goal && min < goal && goal < max)
start = ALIGN(goal, step);
else
start = ALIGN(min, step);


--
Yasunori Goto




\
 
 \ /
  Last update: 2008-06-17 11:37    [W:0.132 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site