cvs commit: src/sys/kern kern_timeout.c

John Baldwin jhb at FreeBSD.org
Fri Aug 31 12:01:31 PDT 2007


jhb         2007-08-31 19:01:30 UTC

  FreeBSD src repository

  Modified files:
    sys/kern             kern_timeout.c 
  Log:
  Close a race that snuck in with the recent changes to fix a LOR between
  the callout_lock spin lock and the sleepqueue spin locks.  In the fix,
  callout_drain() has to drop the callout_lock so it can acquire the
  sleepqueue lock.  The state of the callout can change while the
  callout_lock is held however (for example, it can be rescheduled via
  callout_reset()).  The previous code assumed that the only state change
  that could happen is that the callout could finish executing.  This change
  alters callout_drain() to effectively restart and recheck everything
  after it acquires the sleepqueue lock thus handling all the possible
  states that the callout could be in after any changes while callout_lock
  was dropped.
  
  Approved by:    re (kensmith)
  Tested by:      kris
  
  Revision  Changes    Path
  1.105     +27 -13    src/sys/kern/kern_timeout.c


More information about the cvs-src mailing list