git: kernel - Fix callout_stop/callout_reset rearm race

Matthew Dillon dillon at crater.dragonflybsd.org
Mon Sep 11 00:15:07 PDT 2017


commit d1604347da547e02f356d4a159c59ce4be79a132
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Mon Sep 11 00:11:31 2017 -0700

    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.

Summary of changes:
 sys/kern/kern_timeout.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d1604347da547e02f356d4a159c59ce4be79a132


-- 
DragonFly BSD source repository



More information about the Commits mailing list