vkernel - Fix problem where cpu-bound user process cannot be interrupted
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 5 Apr 2011 00:04:12 +0000 (17:04 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 5 Apr 2011 00:04:12 +0000 (17:04 -0700)
commit56f4b22319e18693e334397d363338a8709f7805
tree44ed25b66cb1427a319548a8e5b5285825c0baa3
parent3d048a1b355265d1e42fd5b3c56d3d4e232325d6
vkernel - Fix problem where cpu-bound user process cannot be interrupted

* Fix an issue where a cpu-bound user process running in a vkernel cannot
  be interrupted from within the vkernel.

  The problem occurs because the timer interrupt was not marked MPSAFE,
  causing the interrupt thread to hold the MP token which then prevented
  the thread preemption code from letting the timer interrupt thread
  preempt the currently running user process.

* Fixed by marking the timer interrupt and other vkernel interrupt
  handlers as being MPSAFE.

* This is a problem for the vkernel and not for normal kernel.  Normal
  kernels have a doreti function which 'catches' pending flags on
  any attempt to return to userland.

  The vkernel does not, instead relying on the preemption mechanic to
  catch pending flags.

Reported-by: Antonio Huete Jimenez <ahuete.devel@gmail.com>
sys/platform/vkernel/platform/console.c
sys/platform/vkernel/platform/cothread.c
sys/platform/vkernel/platform/kqueue.c
sys/platform/vkernel/platform/shutdown.c
sys/platform/vkernel64/platform/console.c
sys/platform/vkernel64/platform/cothread.c
sys/platform/vkernel64/platform/kqueue.c
sys/platform/vkernel64/platform/shutdown.c