mirror of
https://github.com/opnsense/src.git
synced 2026-06-10 09:11:07 -04:00
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:
parent
48bed92485
commit
84e11fbc2e
7 changed files with 42 additions and 42 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue