mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Jackson <pj@sgi.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Paul Jackson <pj@sgi.com>,
	linux-kernel@vger.kernel.org,
	Christoph Lameter <clameter@sgi.com>
Subject: [PATCH] mm: hugetlb alloc_fresh_huge_page bogus node loop fix
Date: Sun, 19 Mar 2006 00:58:01 -0800	[thread overview]
Message-ID: <20060319085801.18847.8908.sendpatchset@jackhammer.engr.sgi.com> (raw)

From: Paul Jackson <pj@sgi.com>

Fix bogus node loop in hugetlb.c alloc_fresh_huge_page(),
which was assuming that nodes are numbered contiguously
from 0 to num_online_nodes().  Once the hotplug folks
get this far, that will be false.

Signed-off-by: Paul Jackson <pj@sgi.com>

---

 mm/hugetlb.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

--- 2.6.16-rc6-mm2.orig/mm/hugetlb.c	2006-03-18 17:29:46.645251774 -0800
+++ 2.6.16-rc6-mm2/mm/hugetlb.c	2006-03-18 21:43:05.101700297 -0800
@@ -105,7 +105,9 @@ static int alloc_fresh_huge_page(void)
 	struct page *page;
 	page = alloc_pages_node(nid, GFP_HIGHUSER|__GFP_COMP|__GFP_NOWARN,
 					HUGETLB_PAGE_ORDER);
-	nid = (nid + 1) % num_online_nodes();
+	nid = next_node(nid, node_online_map);
+	if (nid == MAX_NUMNODES)
+		nid = first_node(node_online_map);
 	if (page) {
 		page[1].lru.next = (void *)free_huge_page;	/* dtor */
 		spin_lock(&hugetlb_lock);

-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <pj@sgi.com> 1.650.933.1373

             reply	other threads:[~2006-03-19  8:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-19  8:58 Paul Jackson [this message]
2006-03-20 15:37 ` Christoph Lameter

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=20060319085801.18847.8908.sendpatchset@jackhammer.engr.sgi.com \
    --to=pj@sgi.com \
    --cc=akpm@osdl.org \
    --cc=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome