Re: [PATCH] [11/18] Fix alignment bug in bootmem allocator

From: Yinghai Lu
Date: Mon Mar 17 2008 - 04:10:42 EST


please check the one against -mm and x86.git

---
From: Andi Kleen <ak@xxxxxxx>

[PATCH] mm: offset align in alloc_bootmem

need offset alignment when node_boot_start's alignment is less than
align required

Index: linux-2.6/mm/bootmem.c
===================================================================
--- linux-2.6.orig/mm/bootmem.c
+++ linux-2.6/mm/bootmem.c
@@ -257,7 +257,7 @@ restart_scan:
unsigned long j;

i = find_next_zero_bit(bdata->node_bootmem_map, eidx, i);
- i = ALIGN(i, incr);
+ i = ALIGN(i + offset, incr) - offset;
if (i >= eidx)
break;
if (test_bit(i, bdata->node_bootmem_map)) {
@@ -273,7 +273,7 @@ restart_scan:
start = i;
goto found;
fail_block:
- i = ALIGN(j, incr);
+ i = ALIGN(j + offset, incr) - offset;
if (i == j)
i += incr;
}