kernel - x86_64 - Add additional checks to lwp_wait() & friends
commit486177ef9c4bdd3da9da4afc6cbc965a1d3b179c
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 23 Oct 2010 16:35:14 +0000 (23 09:35 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 24 Oct 2010 16:36:31 +0000 (24 09:36 -0700)
tree9ad9a6affd8f16b80adecc0bf94f0f2757163c09
parent41252e2ff494168d0c7be453e902f69bd7ce481d
kernel - x86_64 - Add additional checks to lwp_wait() & friends

* lwp_wait() must defer reaping of a lwp that is still running on another
  cpu (i.e. in the midst of exiting).

* It shouldn't be possible for this to happen but just incase the thread
  gets switched out after TDF_EXITING has been set, also make sure
  the threat is no longer on the LWKT run queue.

* Remove old debugging in the LWKT scheduler path.

* Protect gd_freetd (per-cpu td cache) with a critical section.  Again
  this case should not occur as new threads are not allocated from
  interrupts, but protect it anyway.  Also assert that the cached free
  td is in no way still scheduled.

  Note that this cache is required to ensure that the td does not
  end up in the MP-accessible objcache before it has been fully
  descheduled.
sys/kern/kern_exit.c
sys/kern/lwkt_thread.c