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

git: kernel - Fix not-quite-nonblocking VX lock in allocfreevnode()


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 14 Jan 2010 21:57:16 -0800 (PST)

commit 298693f7a0177ad2291be7a6c52371fb311b4a17
Author: Matthew Dillon <dillon@apollo.backplane.com>
Date:   Thu Jan 14 21:51:45 2010 -0800

    kernel - Fix not-quite-nonblocking VX lock in allocfreevnode()
    
    * Introduce LK_NOSPINWAIT to tell lockmgr() to not even spin on the
      spinlock if it can't get it immediately.
    
    * There is a lock order reversal between vfs_spin and vp->v_spinlock
      where vx_lock_nonblock() can deadlock in allocfreevnode().  Normally
      I'd vhold() the vnode but the freelist code is rather fragile and I
      don't want to have to vdrop() later on.  So instead use LK_NOSPINWAIT
      to avoid the situation.
    
    * This is a hack.

Summary of changes:
 sys/kern/kern_lock.c |    9 ++++++++-
 sys/kern/vfs_lock.c  |    7 ++++++-
 sys/sys/lock.h       |    2 +-
 3 files changed, 15 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/298693f7a0177ad2291be7a6c52371fb311b4a17


-- 
DragonFly BSD source repository



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