Additional work to try to make panics operate better on SMP systems.
authorMatthew Dillon <dillon@dragonflybsd.org>
Thu, 21 Jul 2005 06:28:50 +0000 (06:28 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Thu, 21 Jul 2005 06:28:50 +0000 (06:28 +0000)
commitdf6b8ba0c070fde13de0e7d4a211c8e1f010c0c5
tree740e3e91c80ed36bee5fb9bf60867f7fcf5430a0
parentd165e668021c5251200963facd79ae2849eba3be
Additional work to try to make panics operate better on SMP systems.

* Fix a bug in a kernel printf() (that occurs in a panic situation) so
  the printf() itself doesn't fault out.

* The idle thread normally must never hold the BGL across a switch, since the
  switch code must switch to the idle thread if no other threads are available.
  However, since the machine can take a fatal kernel trap or panic in the
  context of the idle thread it is possible for the idle thread to hold the
  BGL during these particular situations.  Additionally, the locking code
  assumes that it can just set the thread's mpcount, call lwkt_switch(), and
  not get the cpu back until the scheduler is able to obtain the BGL on
  behalf of the thread.  So have the scheduler deal with this situation.

  This makes the scheduler look a bit messier then it really is but the code
  paths in question only run during a panic or fatal kernel trap, so
  performance should not be impaired.

From-dumps-provided-by: Peter Avalos <pavalos@theshell.com>
sys/kern/lwkt_thread.c