diff options
author | kib <kib@FreeBSD.org> | 2009-12-28 15:35:39 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2009-12-28 15:35:39 +0000 |
commit | 56603546c67f75a4f5ead37f6bdeb0c40db07c8e (patch) | |
tree | a81c9842f7cffea476b0b314cd36935f10f2731f /sys/kern/vfs_subr.c | |
parent | 1a1b4d40fbcb1094bfdc06f1d802b58f1b8945d3 (diff) | |
download | FreeBSD-src-56603546c67f75a4f5ead37f6bdeb0c40db07c8e.zip FreeBSD-src-56603546c67f75a4f5ead37f6bdeb0c40db07c8e.tar.gz |
Add a knob to allow reclaim of the directory vnodes that are source of
the namecache records. The reclamation is not enabled by default because
for typical workload it would make namecache unusable, but large nested
directory tree easily puts any process that accesses filesystem into 1
second wait for vlru.
Reported by: yar (long time ago)
MFC after: 3 days
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r-- | sys/kern/vfs_subr.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 9fe4d43..87328c1 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -152,6 +152,10 @@ SYSCTL_LONG(_vfs, OID_AUTO, wantfreevnodes, CTLFLAG_RW, &wantfreevnodes, 0, ""); static u_long freevnodes; SYSCTL_LONG(_vfs, OID_AUTO, freevnodes, CTLFLAG_RD, &freevnodes, 0, ""); +static int vlru_allow_cache_src; +SYSCTL_INT(_vfs, OID_AUTO, vlru_allow_cache_src, CTLFLAG_RW, + &vlru_allow_cache_src, 0, "Allow vlru to reclaim source vnode"); + /* * Various variables used for debugging the new implementation of * reassignbuf(). @@ -643,7 +647,9 @@ vlrureclaim(struct mount *mp) * If it's been deconstructed already, it's still * referenced, or it exceeds the trigger, skip it. */ - if (vp->v_usecount || !LIST_EMPTY(&(vp)->v_cache_src) || + if (vp->v_usecount || + (!vlru_allow_cache_src && + !LIST_EMPTY(&(vp)->v_cache_src)) || (vp->v_iflag & VI_DOOMED) != 0 || (vp->v_object != NULL && vp->v_object->resident_page_count > trigger)) { VI_UNLOCK(vp); @@ -668,7 +674,9 @@ vlrureclaim(struct mount *mp) * interlock, the other thread will be unable to drop the * vnode lock before our VOP_LOCK() call fails. */ - if (vp->v_usecount || !LIST_EMPTY(&(vp)->v_cache_src) || + if (vp->v_usecount || + (!vlru_allow_cache_src && + !LIST_EMPTY(&(vp)->v_cache_src)) || (vp->v_object != NULL && vp->v_object->resident_page_count > trigger)) { VOP_UNLOCK(vp, LK_INTERLOCK); |