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

git: kernel - namecache - fix deadlock

From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 31 Dec 2009 19:33:00 -0800 (PST)

commit 65870584d7f6f8000fd009bdb787409342fbc995
Author: Matthew Dillon <dillon@apollo.backplane.com>
Date:   Thu Dec 31 19:08:48 2009 -0800

    kernel - namecache - fix deadlock
    * cache_drop() can be called in numerous situations where unrelated
      vnode or namecache locks are held, particularly in the
      allocfreevnode() path when it calls cache_inval_vp_nonblock().
    * If cache_drop() is transitioning a nc_refs from 1 to 0 it will call
      cache_zap() to free the (now untracked) ncp.  Adjust cache_zap() to
      leave the namecache entry alone if a lock on ncp->nc_parent
      cannot be acquired, instead of blocking (and potentially deadlocking).
    * Add _cache_cleandefered() (part of cache_hysteresis()) to handle
      any buildup.  It is expensive but the race occurs at a low rate
      under moderate load so it should hardly ever have to be run.

Summary of changes:
 sys/kern/vfs_cache.c |  136 ++++++++++++++++++++++++++++++++++++++++----------
 sys/kern/vfs_mount.c |    2 +-
 sys/sys/namecache.h  |    4 +-
 3 files changed, 113 insertions(+), 29 deletions(-)


DragonFly BSD source repository

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