From owner-svn-src-all@FreeBSD.ORG Mon Dec 28 15:35:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A58DC106566B; Mon, 28 Dec 2009 15:35:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A59F8FC16; Mon, 28 Dec 2009 15:35:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSFZdaj094489; Mon, 28 Dec 2009 15:35:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSFZdBi094487; Mon, 28 Dec 2009 15:35:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912281535.nBSFZdBi094487@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Dec 2009 15:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201134 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 15:35:39 -0000 Author: kib Date: Mon Dec 28 15:35:39 2009 New Revision: 201134 URL: http://svn.freebsd.org/changeset/base/201134 Log: 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 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Dec 28 15:06:44 2009 (r201133) +++ head/sys/kern/vfs_subr.c Mon Dec 28 15:35:39 2009 (r201134) @@ -152,6 +152,10 @@ SYSCTL_LONG(_vfs, OID_AUTO, wantfreevnod 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);