diff options
-rw-r--r-- | sys/ia64/ia64/mp_machdep.c | 22 |
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); |