diff options
author | Haren Myneni <haren@us.ibm.com> | 2005-12-12 03:37:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-12-12 11:57:45 -0500 |
commit | 66d43e98ea6ff291cd4e524386bfb99105feb180 (patch) | |
tree | 56cff27261a3f9b16022c9ec8d53e4913f758eb9 | |
parent | ff9569bc5558e958777fd43580f2ccd83733cdf6 (diff) |
[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: Haren Myneni <haren@us.ibm.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Cc: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | mm/bootmem.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/bootmem.c b/mm/bootmem.c index e8c567177dcf..16b9465eb4eb 100644 --- a/mm/bootmem.c +++ b/mm/bootmem.c | |||
@@ -204,6 +204,8 @@ restart_scan: | |||
204 | unsigned long j; | 204 | unsigned long j; |
205 | i = find_next_zero_bit(bdata->node_bootmem_map, eidx, i); | 205 | i = find_next_zero_bit(bdata->node_bootmem_map, eidx, i); |
206 | i = ALIGN(i, incr); | 206 | i = ALIGN(i, incr); |
207 | if (i >= eidx) | ||
208 | break; | ||
207 | if (test_bit(i, bdata->node_bootmem_map)) | 209 | if (test_bit(i, bdata->node_bootmem_map)) |
208 | continue; | 210 | continue; |
209 | for (j = i + 1; j < i + areasize; ++j) { | 211 | for (j = i + 1; j < i + areasize; ++j) { |