linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: torvalds@osdl.org
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] fix bootmem allocator on machines with holes in memory
Date: Thu, 17 Jul 2003 05:46:46 +1000	[thread overview]
Message-ID: <20030716194646.GA793@krispykreme> (raw)


Hi,

If the memory we are trying to allocate is too large to fit in the
current region, we should skip to the end. We currently search the
available bitmap, find the area is too small, increment the start by
incr and try again. This resulted in an apparent lockup on a 64GB
machine that had a 3GB IO hole starting at 1GB (and the mem_map array
would not fit in the first region).

Also use ALIGN macro instead of an open coded version.

Anton

===== mm/bootmem.c 1.18 vs edited =====
--- 1.18/mm/bootmem.c	Sat Jul  5 16:52:55 2003
+++ edited/mm/bootmem.c	Thu Jul 17 05:00:42 2003
@@ -183,7 +183,7 @@
 	for (i = preferred; i < eidx; i += incr) {
 		unsigned long j;
 		i = find_next_zero_bit(bdata->node_bootmem_map, eidx, i);
-		i = (i + incr - 1) & -incr;
+		i = ALIGN(i, incr);
 		if (test_bit(i, bdata->node_bootmem_map))
 			continue;
 		for (j = i + 1; j < i + areasize; ++j) {
@@ -195,7 +195,7 @@
 		start = i;
 		goto found;
 	fail_block:
-		;
+		i = ALIGN(j, incr);
 	}
 
 	if (preferred > offset) {

                 reply	other threads:[~2003-07-16 19:34 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=20030716194646.GA793@krispykreme \
    --to=anton@samba.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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;
as well as URLs for NNTP newsgroup(s).