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

git: kernel - RB_SCAN() requires a short-term spinlock


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 28 Nov 2011 22:09:42 -0800 (PST)

commit 5f97768d56d8f4feadf9407630849bdd67cad2f1
Author: Matthew Dillon <dillon@apollo.backplane.com>
Date:   Mon Nov 28 22:03:23 2011 -0800

    kernel - RB_SCAN() requires a short-term spinlock
    
    * RB_SCAN() links and unlinks an info structure.  If called with a shared
      lock the linking and unlinking operations requires a very short-term spin
      lock to avoid clobbering each other.
    
    * Note that RB_REMOVE() scans the inprog list but this function can only
      be safely called with the RB tree held exclusively anyway, so there's
      no need to spinlock the info list.
    
    * Add kern/subr_rbtree.c glue functions for acquiring and releasing the
      spinlock, so sys/tree.h only needs to include sys/spinlock.h and not
      also sys/spinlock2.h
    
    Reported-by: sephe

Summary of changes:
 sys/conf/files                           |    1 +
 sys/kern/{subr_shims.c => subr_rbtree.c} |   47 ++++++++++++++++--------------
 sys/sys/tree.h                           |   26 +++++++++++++++-
 3 files changed, 50 insertions(+), 24 deletions(-)
 copy sys/kern/{subr_shims.c => subr_rbtree.c} (74%)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5f97768d56d8f4feadf9407630849bdd67cad2f1


-- 
DragonFly BSD source repository



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