[PATCH] ppc64 NUMA code needs an IQ injection

Nathan Lynch nathanl at austin.ibm.com
Fri Nov 19 15:39:06 EST 2004


Ran into this on a 4GB partition - all but about ~300MB was thrown away.

Does this look ok?  It works for me, but I've not tested on firmware
without the bug.

Fall back to non-numa setup upon discovering unexpected memory layout
as presented by firmware, instead of throwing away regions.

Signed-off-by: Nathan Lynch <nathanl at austin.ibm.com>


Index: linux-2.6.10-rc2-bk3/arch/ppc64/mm/numa.c
===================================================================
--- linux-2.6.10-rc2-bk3.orig/arch/ppc64/mm/numa.c	2004-11-19 02:14:28.000000000 +0000
+++ linux-2.6.10-rc2-bk3/arch/ppc64/mm/numa.c	2004-11-19 03:58:22.000000000 +0000
@@ -345,8 +345,6 @@
 			numa_domain = 0;
 		}
 
-		node_set_online(numa_domain);
-
 		if (max_domain < numa_domain)
 			max_domain = numa_domain;
 
@@ -361,14 +359,18 @@
 				init_node_data[numa_domain].node_start_pfn +
 				init_node_data[numa_domain].node_spanned_pages;
 			if (shouldstart != (start / PAGE_SIZE)) {
-				printk(KERN_ERR "WARNING: Hole in node, "
-						"disabling region start %lx "
-						"length %lx\n", start, size);
-				continue;
+				/* Revert to non-numa for now */
+				printk(KERN_ERR
+				       "WARNING: Unexpected node layout: "
+				       "region start %lx length %lx\n",
+				       start, size);
+				goto err;
 			}
 			init_node_data[numa_domain].node_spanned_pages +=
 				size / PAGE_SIZE;
 		} else {
+			node_set_online(numa_domain);
+
 			init_node_data[numa_domain].node_start_pfn =
 				start / PAGE_SIZE;
 			init_node_data[numa_domain].node_spanned_pages =
@@ -387,6 +389,15 @@
 	numnodes = max_domain + 1;
 
 	return 0;
+err:
+	/* Something has gone wrong; revert any setup we've done */
+	for_each_node(i) {
+		node_set_offline(i);
+		init_node_data[i].node_start_pfn = 0;
+		init_node_data[i].node_spanned_pages = 0;
+	}
+	numnodes = 1;
+	return -1;
 }
 
 static void __init setup_nonnuma(void)





More information about the Linuxppc64-dev mailing list