6896720 new CPU added to lgrp partition list too early during boot, causes intermittent boot hang
--- a/usr/src/uts/sun4/os/mp_startup.c Fri Mar 26 10:44:54 2010 -0700
+++ b/usr/src/uts/sun4/os/mp_startup.c Fri Mar 26 10:54:46 2010 -0700
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -137,6 +137,17 @@
cp->cpu_dispthread = tp;
cp->cpu_dispatch_pri = DISP_PRIO(tp);
cp->cpu_startup_thread = tp;
+
+ /*
+ * The dispatcher may discover the CPU before it is in cpu_ready_set
+ * and attempt to poke it. Before the CPU is in cpu_ready_set, any
+ * cross calls to it will be dropped. We initialize
+ * poke_cpu_outstanding to true so that poke_cpu will ignore any poke
+ * requests for this CPU. Pokes that come in before the CPU is in
+ * cpu_ready_set can be ignored because the CPU is about to come
+ * online.
+ */
+ cp->cpu_m.poke_cpu_outstanding = B_TRUE;
}
/*
@@ -586,7 +597,6 @@
mach_htraptrace_configure(cp->cpu_id);
cpu_intrq_register(CPU);
cp->cpu_m.mutex_ready = 1;
- cp->cpu_m.poke_cpu_outstanding = B_FALSE;
/* acknowledge that we are done with initialization */
CPUSET_ADD(proxy_ready_set, cp->cpu_id);
@@ -608,6 +618,11 @@
while (!CPU_IN_SET(cpu_ready_set, cp->cpu_id))
DELAY(1);
+ /*
+ * The CPU is now in cpu_ready_set, safely able to take pokes.
+ */
+ cp->cpu_m.poke_cpu_outstanding = B_FALSE;
+
/* enable interrupts */
(void) spl0();