summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_smp.c
diff options
context:
space:
mode:
authorbmilekic <bmilekic@FreeBSD.org>2001-01-28 03:41:01 +0000
committerbmilekic <bmilekic@FreeBSD.org>2001-01-28 03:41:01 +0000
commit4f534409b335d30a310d938fc3fef458a51b57a5 (patch)
tree81c4004d805e0b17641ad8b1d3dc37f2a8d90d89 /sys/kern/subr_smp.c
parent55837ed17a3a2de16bb80beea9044a80a8306d29 (diff)
downloadFreeBSD-src-4f534409b335d30a310d938fc3fef458a51b57a5.zip
FreeBSD-src-4f534409b335d30a310d938fc3fef458a51b57a5.tar.gz
Move the setting of curproc to idleproc up earlier in ap_init(). The
problem is that a mutex lock, prior to this change, is acquired before the curproc is set to idleproc, so we mess ourselves up by calling the mutex lock routine with curproc == NULL. Moving it up after the aps_ready spin-wait has us hopefully setting it after idleproc is setup. Solved by: jake (the allmighty) :-)
Diffstat (limited to 'sys/kern/subr_smp.c')
-rw-r--r--sys/kern/subr_smp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c
index b9e96fe..95ad79a 100644
--- a/sys/kern/subr_smp.c
+++ b/sys/kern/subr_smp.c
@@ -2266,6 +2266,12 @@ ap_init(void)
while (!aps_ready)
/* spin */ ;
+ /*
+ * Set curproc to our per-cpu idleproc so that mutexes have
+ * something unique to lock with.
+ */
+ PCPU_SET(curproc, PCPU_GET(idleproc));
+
/* lock against other AP's that are waking up */
mtx_enter(&ap_boot_mtx, MTX_SPIN);
@@ -2322,12 +2328,6 @@ ap_init(void)
while (smp_started == 0)
; /* nothing */
- /*
- * Set curproc to our per-cpu idleproc so that mutexes have
- * something unique to lock with.
- */
- PCPU_SET(curproc, PCPU_GET(idleproc));
-
microuptime(PCPU_PTR(switchtime));
PCPU_SET(switchticks, ticks);
OpenPOWER on IntegriCloud