cvs commit: src/sys/kern kern_timeout.c

Attilio Rao attilio at FreeBSD.org
Tue Jun 26 21:42:03 UTC 2007


attilio     2007-06-26 21:42:01 UTC

  FreeBSD src repository

  Modified files:
    sys/kern             kern_timeout.c 
  Log:
  Fix an old standing LOR between callout_lock and sleepqueues chain (which
  could lead to a deadlock).
  - sleepq_set_timeout acquires callout_lock (via callout_reset()) only
    with sleepq chain lock held
  - msleep_spin in _callout_stop_safe lock the sleepqueue chain with
    callout_lock held
  
  In order to solve this don't use msleep_spin in _callout_stop_safe() but
  use directly sleepqueues as inline msleep_spin code. Rearrange the
  wakeup path in order to have it consistent too.
  
  Reported by: kris (via stress2 test suite)
  Tested by: Timothy Redaelli <drizzt at gufi.org>
  Reviewed by: jhb
  Approved by: jeff (mentor)
  Approved by: re
  
  Revision  Changes    Path
  1.104     +35 -3     src/sys/kern/kern_timeout.c


More information about the cvs-src mailing list