git: kernel - namecache - fix deadlock

看板DFBSD_commit作者時間16年前 (2010/01/01 12:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
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(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/65870584d7f6f8000fd009bdb787409342fbc995 -- DragonFly BSD source repository
文章代碼(AID): #1BFNE3Xq (DFBSD_commit)