DragonFly BSD
DragonFly commits List (threaded) for 2011-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

git: kernel - Refactor dsched ref/unref routines


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 1 Mar 2011 15:58:04 -0800 (PST)

commit 265b0d4af67ddbef1cf048a4fd2783bfdec1795c
Author: Matthew Dillon <dillon@apollo.backplane.com>
Date:   Tue Mar 1 15:52:19 2011 -0800

    kernel - Refactor dsched ref/unref routines
    
    * Refactor the dsched ref/unref routines to handle 1->0 transitions
      atomically and to properly deal with 1->0 races related to any
      re-referencing of the structure which can occur concurrently.
    
      Such races can occur because the structure must acquire other locks
      while removing itself from the various lists it is on and thus can
      be accessed via those lists in the mean time.
    
      Instead of using -0x400 as a separate atomic op after a 1->0 transition
      we directly transition from 1 to 0x80000000, removing a race condition.
    
      This also allows temporary references to be made during destruction.
    
    * Get a temporary ref and re-check flag state after acquiring a lock to
      determine if the structure in question is still on the list we are trying
      to remove it from.

Summary of changes:
 sys/kern/kern_dsched.c |  260 ++++++++++++++++++++++++++++++++---------------
 1 files changed, 177 insertions(+), 83 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/265b0d4af67ddbef1cf048a4fd2783bfdec1795c


-- 
DragonFly BSD source repository



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]