Commit 66d43e98 authored by Haren Myneni's avatar Haren Myneni Committed by Linus Torvalds

[PATCH] fix in __alloc_bootmem_core() when there is no free page in first node's memory

Hitting BUG_ON() in __alloc_bootmem_core() when there is no free page
available in the first node's memory.  For the case of kdump on PPC64
(Power 4 machine), the captured kernel is used two memory regions - memory
for TCE tables (tce-base and tce-size at top of RAM and reserved) and
captured kernel memory region (crashk_base and crashk_size).  Since we
reserve the memory for the first node, we should be returning from
__alloc_bootmem_core() to search for the next node (pg_dat).

Currently, find_next_zero_bit() is returning the n^th bit (eidx) when there
is no free page.  Then, test_bit() is failed since we set 0xff only for the
actual size initially (init_bootmem_core()) even though rounded up to one
page for bdata->node_bootmem_map.  We are hitting the BUG_ON after failing
to enter second "for" loop.
Signed-off-by: default avatarHaren Myneni <haren@us.ibm.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Cc: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ff9569bc
...@@ -204,6 +204,8 @@ __alloc_bootmem_core(struct bootmem_data *bdata, unsigned long size, ...@@ -204,6 +204,8 @@ __alloc_bootmem_core(struct bootmem_data *bdata, unsigned long size,
unsigned long j; unsigned long j;
i = find_next_zero_bit(bdata->node_bootmem_map, eidx, i); i = find_next_zero_bit(bdata->node_bootmem_map, eidx, i);
i = ALIGN(i, incr); i = ALIGN(i, incr);
if (i >= eidx)
break;
if (test_bit(i, bdata->node_bootmem_map)) if (test_bit(i, bdata->node_bootmem_map))
continue; continue;
for (j = i + 1; j < i + areasize; ++j) { for (j = i + 1; j < i + areasize; ++j) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment