changeset 10410:0ee842861e3b

6834743 system panic due to lgrp_ functions during OS installation
author Jonathan Chew <jonathan.chew@sun.com>
date Sat, 29 Aug 2009 12:28:42 -0700
parents 1f7aaa44950d
children 4d4d89528e72
files usr/src/uts/i86pc/os/lgrpplat.c
diffstat 1 files changed, 13 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/i86pc/os/lgrpplat.c	Fri Aug 28 17:03:35 2009 -0700
+++ b/usr/src/uts/i86pc/os/lgrpplat.c	Sat Aug 29 12:28:42 2009 -0700
@@ -1178,6 +1178,7 @@
 	int				from;
 	int				i;
 	lgrp_plat_latency_stats_t	*lat_stats;
+	boolean_t			probed;
 	hrtime_t			probe_time;
 	int				to;
 
@@ -1206,16 +1207,20 @@
 	 * so we can build latency topology of machine later.
 	 * This should approximate the memory latency between each node.
 	 */
+	probed = B_FALSE;
 	for (i = 0; i < lgrp_plat_probe_nrounds; i++) {
 		for (to = 0; to < lgrp_plat_node_cnt; to++) {
 			/*
-			 * Get probe time and bail out if can't get it yet
+			 * Get probe time and skip over any nodes that can't be
+			 * probed yet or don't have memory
 			 */
 			probe_time = lgrp_plat_probe_time(to,
 			    lgrp_plat_cpu_node, &lgrp_plat_probe_mem_config,
 			    &lgrp_plat_lat_stats, &lgrp_plat_probe_stats);
 			if (probe_time == 0)
-				return;
+				continue;
+
+			probed = B_TRUE;
 
 			/*
 			 * Keep lowest probe time as latency between nodes
@@ -1237,6 +1242,12 @@
 	}
 
 	/*
+	 * Bail out if weren't able to probe any nodes from current CPU
+	 */
+	if (probed == B_FALSE)
+		return;
+
+	/*
 	 * - Fix up latencies such that local latencies are same,
 	 *   latency(i, j) == latency(j, i), etc. (if possible)
 	 *
@@ -1491,8 +1502,6 @@
 	 * if they are close enough together
 	 */
 	for (i = 0; i < lgrp_plat_node_cnt; i++) {
-		if (!node_memory[i].exists)
-			continue;
 		for (j = 0; j < lgrp_plat_node_cnt; j++) {
 			if (!node_memory[j].exists)
 				continue;
@@ -1510,8 +1519,6 @@
 				continue;
 
 			for (k = 0; k < lgrp_plat_node_cnt; k++) {
-				if (!node_memory[k].exists)
-					continue;
 				for (l = 0; l < lgrp_plat_node_cnt; l++) {
 					if (!node_memory[l].exists)
 						continue;
@@ -1633,8 +1640,6 @@
 	 */
 	lat_stats->latency_max = 0;
 	for (i = 0; i < lgrp_plat_node_cnt; i++) {
-		if (!node_memory[i].exists)
-			continue;
 		for (j = 0; j < lgrp_plat_node_cnt; j++) {
 			if (!node_memory[j].exists)
 				continue;
@@ -1726,8 +1731,6 @@
 	 */
 	if (t1) {
 		for (i = 0; i < lgrp_plat_node_cnt; i++) {
-			if (!node_memory[i].exists)
-				continue;
 			for (j = 0; j < lgrp_plat_node_cnt; j++) {
 				if (!node_memory[j].exists)
 					continue;