kernel - Fix callout_stop/callout_reset rearm race
commitd1604347da547e02f356d4a159c59ce4be79a132
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 11 Sep 2017 07:11:31 +0000 (11 00:11 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 11 Sep 2017 07:15:05 +0000 (11 00:15 -0700)
treed1e54b830ed4837fb555b5125e9935b08cbafe3f
parent068e3f9446fa3e0e5463e4122e991e061440e451
kernel - Fix callout_stop/callout_reset rearm race

* If a callout_reset() occurs while a callout_stop() is running, the
  callout_stop() can wind up blocking forever.  Change the conditional
  to break out of the processing loop to simply wait for the IPI to finish
  executing, and if the callout is still armed due to a callout_reset()
  the callout_stop() simply loops back to the top and retries the stop.

* Can be reproduced when itimers are used heavily (typically ghc processes
  that run during a bulk synth run).

* Race tested and verified to occur, fix appears to solve the problem.
sys/kern/kern_timeout.c