public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Haren Myneni <haren@us.ibm.com>
To: linux-kernel@vger.kernel.org, linuxppc64-dev@ozlabs.org
Subject: [PATCH] Trivial fix in __alloc_bootmem_core() when there is no free page in first node's memory
Date: Tue, 06 Dec 2005 17:53:37 -0800	[thread overview]
Message-ID: <439640A1.3030300@us.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 910 bytes --]

Hi,
    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.

Please apply.

Thanks
Haren

Signed-off-by: Haren Myneni <haren@us.ibm.com>





[-- Attachment #2: bootmem_bug_on_fix.patch --]
[-- Type: text/x-patch, Size: 413 bytes --]

--- 2.6.15-rc5-git1/mm/bootmem.c.orig	2005-12-14 21:28:46.000000000 -0800
+++ 2.6.15-rc5-git1/mm/bootmem.c	2005-12-14 21:35:54.000000000 -0800
@@ -204,6 +204,8 @@ restart_scan:
 		unsigned long j;
 		i = find_next_zero_bit(bdata->node_bootmem_map, eidx, i);
 		i = ALIGN(i, incr);
+		if (i >= eidx)
+			break;
 		if (test_bit(i, bdata->node_bootmem_map))
 			continue;
 		for (j = i + 1; j < i + areasize; ++j) {

                 reply	other threads:[~2005-12-07  1:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=439640A1.3030300@us.ibm.com \
    --to=haren@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc64-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox