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) :-)
This commit is contained in:
bmilekic 2001-01-28 03:41:01 +00:00
parent 55837ed17a
commit 4f534409b3
7 changed files with 42 additions and 42 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);