Fix a number of SMP issues.
authorMatthew Dillon <dillon@dragonflybsd.org>
Sat, 20 Nov 2004 20:50:36 +0000 (20:50 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sat, 20 Nov 2004 20:50:36 +0000 (20:50 +0000)
commit8b6d0f3f8135cff4da392f471fe1c6e3095b8203
treecadf26ffe1c7faf1574c4c607b9342bc8a334817
parentf2555cdd59f525c2f43af64c4ed09c3a44de6ae3
Fix a number of SMP issues.

* Add required pause instructions in code paths that skip running "HLT".  This
  occurs when e.g. cpu #1 is running code with the BGL while cpu #2's only
  runnable thread requires the BGL.  cpu #2's LWKT scheduler spins in that
  case.  Similar situations can occur when the only runnable threads on a
  cpu are waiting for a token.

* Add required pause instructions to spin loops.  DragonFly has very few spin
  locks (e.g. things like com_lock()) but its a good idea anyway to avoid
  known livelock issues on Intel cpus.

* Fix a pending interrupt / HLT race.  We were not atomically retiring
  pending interrupts prior to potentially HLTing the cpu.  This could
  result in an SMP machine's network locking up until a key is hit on
  the console, then magically resuming.

Lockups-reported-by: Peter Avalos <pavalos@theshell.com>
sys/dev/acpica5/acpi_cpu.c
sys/i386/i386/machdep.c
sys/i386/i386/mplock.s
sys/i386/include/lock.h
sys/platform/pc32/i386/machdep.c
sys/platform/pc32/i386/mplock.s
sys/platform/pc32/include/lock.h