summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2006-02-11 19:55:18 +0000
committermarcel <marcel@FreeBSD.org>2006-02-11 19:55:18 +0000
commitac97d94d79c75ccd21c3a0c3653a602fe963e4da (patch)
tree4cd4be77544764f054848475c835a5a2fb4ab35f /sys/ia64
parentcea51dc68cfd5f1b687c7469fd15c26634068d5f (diff)
downloadFreeBSD-src-ac97d94d79c75ccd21c3a0c3653a602fe963e4da.zip
FreeBSD-src-ac97d94d79c75ccd21c3a0c3653a602fe963e4da.tar.gz
Correct the spinlock nesting of the idle thread of the APs before we
save the MCA state of the AP. Saving the MCA state of the AP requires us to allocate memory, which uses sleep locks. Now that we correct the spinlock nesting of the AP without having schedlock, avoid calling spinlock_exit(). Instead call critical_exit() and manually clear the MD spinlock count. MFC after: 3 days
Diffstat (limited to 'sys/ia64')
-rw-r--r--sys/ia64/ia64/mp_machdep.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/sys/ia64/ia64/mp_machdep.c b/sys/ia64/ia64/mp_machdep.c
index 0b9e7dd..a989577 100644
--- a/sys/ia64/ia64/mp_machdep.c
+++ b/sys/ia64/ia64/mp_machdep.c
@@ -112,6 +112,16 @@ ia64_ap_startup(void)
PCPU_SET(curthread, PCPU_GET(idlethread));
/*
+ * Correct spinlock nesting. The idle thread context that we are
+ * borrowing was created so that it would start out with a single
+ * spin lock (sched_lock) held in fork_trampoline(). Since we
+ * don't have any locks and explicitly acquire locks when we need
+ * to, the nesting count will be off by 1.
+ */
+ curthread->td_md.md_spinlock_count = 0;
+ critical_exit();
+
+ /*
* Get and save the CPU specific MCA records. Should we get the
* MCA state for each processor, or just the CMC state?
*/
@@ -126,18 +136,6 @@ ia64_ap_startup(void)
mtx_lock_spin(&sched_lock);
- /*
- * Correct spinlock nesting. The idle thread context that we are
- * borrowing was created so that it would start out with a single
- * spin lock (sched_lock) held in fork_trampoline(). Since we've
- * explicitly acquired locks in this function, the nesting count
- * is now 2 rather than 1. Since we are nested, calling
- * spinlock_exit() will simply adjust the counts without allowing
- * spin lock using code to interrupt us.
- */
- spinlock_exit();
- KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count"));
-
PCPU_SET(switchtime, cpu_ticks());
PCPU_SET(switchticks, ticks);
OpenPOWER on IntegriCloud