HAMMER (and kernel) - Fix cpu-bound kernel thread issue.
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 20 Jun 2009 00:04:31 +0000 (17:04 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 20 Jun 2009 00:04:31 +0000 (17:04 -0700)
commit3824f392898599ea8ff8c7709bb9f8537c1b3a78
treee0902724d8368bc955970ab0045b1bf617b01b0f
parent0faa08a1442b9ebf0082dce5298b2f0a23604ba7
HAMMER (and kernel) - Fix cpu-bound kernel thread issue.

* HAMMER now calls a new kernel function, lwkt_user_yield(), in its
  ioctl-based loops (such as the reblocker).

* Add a new LWKT function called lwkt_user_yield().  This function
  causes a kernel thread to yield at user priority (instead of kernel
  priority).

  This function also deals with a nasty issue related to the MP lock.
  A cpu-bound kernel thread holding the MP lock can prevent other
  cpus from serving interrupt threads which also need the MP lock.
  Detect the condition and release the MP lock for 10uS to give the
  other cpus a chance to pick it up.  This is a bad hack but it
  actually does work.

* Move passive_release() from MD code to kern/lwkt_thread.c and add
  an inline for the passive release recovery function.  Adjust all
  platforms to use the new API instead of rolling the same code for
  each platform.

Reported-by: Many, but especially Hasso Tepper <hasso@estpak.ee>
sys/kern/lwkt_thread.c
sys/platform/pc32/i386/trap.c
sys/platform/pc64/amd64/trap.c
sys/platform/vkernel/i386/trap.c
sys/sys/thread.h
sys/sys/thread2.h
sys/vfs/hammer/hammer_signal.c