linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for 2.6.16] Handle holes in node mask in node fallback list initialization
@ 2006-02-17  1:23 Andi Kleen
  2006-02-17  1:40 ` Christoph Lameter
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Andi Kleen @ 2006-02-17  1:23 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, Christoph Lameter, linux-mm

The new function to set up the node fallback lists didn't handle
holes in the node map. This happens e.g. on Opterons when 
the a CPU is missing memory, which is not that uncommon. 

Empty nodes are not initialization, but the node number is still 
allocated. And then it would early except or even triple fault here  
because it would try to set  up a fallback list for a NULL pgdat. Oops.

There was actually another bug that caused problems in this
configuration - fixed in the earlier x86-64 patchkit. But 
this is the second fix to make it actually boot.

This change makes sure the fallback list initialization really 
looks at all nodes (when there is a hole num_online_nodes() isn't 
the highest index) and also skips missing nodes.

Cc: clameter@engr.sgi.com

Signed-off-by: Andi Kleen <ak@suse.de>

Index: linux/mm/page_alloc.c
===================================================================
--- linux.orig/mm/page_alloc.c
+++ linux/mm/page_alloc.c
@@ -1540,12 +1540,19 @@ static int __init find_next_best_node(in
 	int i, n, val;
 	int min_val = INT_MAX;
 	int best_node = -1;
+	int highest_node = 0;
+
+	for_each_online_node(i) 
+		highest_node = i; 
 
 	for_each_online_node(i) {
 		cpumask_t tmp;
 
 		/* Start from local node */
-		n = (node+i) % num_online_nodes();
+		n = (node+i) % (highest_node + 1);
+		/* Handle holes in the nodemask */
+		if (!NODE_DATA(n))
+			continue;
 
 		/* Don't want a node to appear more than once */
 		if (node_isset(n, *used_node_mask))

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2006-02-17 18:38 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-17  1:23 [PATCH for 2.6.16] Handle holes in node mask in node fallback list initialization Andi Kleen
2006-02-17  1:40 ` Christoph Lameter
2006-02-17  1:46   ` Andi Kleen
2006-02-17  2:12     ` KAMEZAWA Hiroyuki
2006-02-17  1:51 ` Christoph Lameter
2006-02-17  2:10   ` Andi Kleen
2006-02-17  2:46     ` Christoph Lameter
2006-02-17  6:10   ` Yasunori Goto
2006-02-17  9:58     ` Andi Kleen
2006-02-17 11:23       ` Bob Picco
2006-02-17 12:15         ` Andi Kleen
2006-02-17 14:34           ` Lee Schermerhorn
2006-02-17 16:05     ` Christoph Lameter
2006-02-17  3:33 ` Yasunori Goto
2006-02-17 16:52 ` Linus Torvalds
2006-02-17 18:07   ` Andi Kleen
2006-02-17 18:38     ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox