From owner-svn-src-all@FreeBSD.ORG Mon Feb 23 15:34:28 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 A36D710656CE; Mon, 23 Feb 2009 15:34:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 736C28FC21; Mon, 23 Feb 2009 15:34:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 046E946B23; Mon, 23 Feb 2009 10:34:27 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n1NFY2kr016392; Mon, 23 Feb 2009 10:34:22 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Scott Long Date: Mon, 23 Feb 2009 10:10:44 -0500 User-Agent: KMail/1.9.7 References: <200902192218.n1JMI1HF009245@svn.freebsd.org> <499DF860.8020903@samsco.org> In-Reply-To: <499DF860.8020903@samsco.org> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200902231010.45511.jhb@freebsd.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 23 Feb 2009 10:34:22 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/9031/Mon Feb 23 08:19:18 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188832 - head/sys/nfsclient 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, 23 Feb 2009 15:34:29 -0000 On Thursday 19 February 2009 7:25:04 pm Scott Long wrote: > John Baldwin wrote: > > Author: jhb > > Date: Thu Feb 19 22:18:00 2009 > > New Revision: 188832 > > URL: http://svn.freebsd.org/changeset/base/188832 > > > > Log: > > When fetching attributes for a file for NFSv3 mounts, do not perform an > > opportunistic ACCESS RPC to populate both the access and attribute caches > > of the file and instead always use a GETATTR RPC. On many modern NFS > > servers, an ACCESS RPC is much more expensive to service than a GETATTR > > RPC. > > > > Not too long ago, this was a very useful and important optimization. > Can you say which servers this applies to? Could it have been made an > option instead of outright deleted? I know this applies to at least some Net-Apps. I could certainly restore the access priming under a sysctl however. Something like this: --- //depot/projects/smpng/sys/nfsclient/nfs_vnops.c 2009/02/20 15:11:39 +++ //depot/user/jhb/lock/nfsclient/nfs_vnops.c 2009/02/23 15:09:16 @@ -208,6 +208,11 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_timeout, CTLFLAG_RW, &nfsaccess_cache_timeout, 0, "NFS ACCESS cache timeout"); +static int nfs_prime_access_cache = 0; +SYSCTL_INT(_vfs_nfs, OID_AUTO, prime_access_cache, CTLFLAG_RW, + &nfs_prime_access_cache, 0, + "Prime NFS ACCESS cache when fetching attributes"); + static int nfsv3_commit_on_close = 0; SYSCTL_INT(_vfs_nfs, OID_AUTO, nfsv3_commit_on_close, CTLFLAG_RW, &nfsv3_commit_on_close, 0, "write+commit on close, else only write"); @@ -644,6 +649,12 @@ */ if (nfs_getattrcache(vp, &vattr) == 0) goto nfsmout; + if (v3 && nfs_prime_access_cache && nfsaccess_cache_timeout > 0) { + nfsstats.accesscache_misses++; + nfs3_access_otw(vp, NFSV3ACCESS_ALL, td, ap->a_cred); + if (nfs_getattrcache(vp, &vattr) == 0) + goto nfsmout; + } nfsstats.rpccnt[NFSPROC_GETATTR]++; mreq = nfsm_reqhead(vp, NFSPROC_GETATTR, NFSX_FH(v3)); mb = mreq; -- John Baldwin