kernel - Fix excessive ipiq recursion (4)
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 23 Jul 2016 04:58:59 +0000 (21:58 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 23 Jul 2016 05:04:15 +0000 (22:04 -0700)
commitd5b1e1b2262237814815a265277a415bc2dedf43
tree3c24f9c9e222522cda9ba70c2f29a708b93f0c01
parenta2cfa33e13f0f323f2342ce4a42c78f06297354a
kernel - Fix excessive ipiq recursion (4)

* Possibly the smoking gun.  There was a case where the lwkt_switch()
  code could wind up looping excessively calling lwkt_getalltokens()
  if td_contended went negative, and td_contended on interrupt threads
  could in-fact go negative.

  This stopped IPIs in their tracks.

* Fix by making td_contended unsigned, causing the comparions to work
  in all situations.  And add a missing assignment to 0 for the
  preempted thread case.
sys/kern/lwkt_thread.c
sys/sys/thread.h