From owner-svn-src-head@FreeBSD.ORG Mon Nov 10 20:14:17 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 194DE106568A; Mon, 10 Nov 2008 20:14:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 89CB88FC14; Mon, 10 Nov 2008 20:14:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mAAKE4ag066594; Mon, 10 Nov 2008 15:14:10 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: "Peter Wemm" Date: Mon, 10 Nov 2008 11:33:51 -0500 User-Agent: KMail/1.9.7 References: <200811041904.mA4J41dL005103@svn.freebsd.org> <200811041750.08355.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811101133.51947.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Mon, 10 Nov 2008 15:14:10 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8599/Mon Nov 10 11:43:18 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.4 required=4.2 tests=AWL,BAYES_00, DATE_IN_PAST_03_06,NO_RELAYS 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, Ivan Voras Subject: Re: svn commit: r184652 - in head/sys: dev/hwpmc fs/procfs kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2008 20:14:17 -0000 On Thursday 06 November 2008 10:21:37 am Peter Wemm wrote: > On Tue, Nov 4, 2008 at 2:50 PM, John Baldwin wrote: > > On Tuesday 04 November 2008 05:22:47 pm Ivan Voras wrote: > >> 2008/11/4 John Baldwin : > >> > Author: jhb > >> > Date: Tue Nov 4 19:04:01 2008 > >> > New Revision: 184652 > >> > URL: http://svn.freebsd.org/changeset/base/184652 > >> > > >> > Log: > >> > Remove unnecessary locking around vn_fullpath(). The vnode lock for the > >> > >> Does this affect realpath(3)? (whose non-scalability is often reported > >> for PHP web servers). > > > > realpath(3) calls getcwd(3) (which devolves to __getcwd(2) I think) once per > > invocation (and that already did not lock the vnode). It then calls lstat() > > for each component in the path. The lstat() calls should be using shared > > locks (at least with the recent changes to use shared lookups for UFS in > > HEAD). I imagine the bottleneck is more with lstat() than getcwd(3). > > Neither is helped by the specific changes above. > > Hmm. Would it make sense to provide a helper syscall specifically for > php to use for this? Without having looked at the php code, it sounds > like it might be helpful to have a syscall that returns the path and > an array of stat structs for each path component. Or is php only > doing this because of compatability with non-atomic getcwd() > implementations? Does php even need to do it? We could possibly move realpath(3) into the kernel. svr4 compat has svr4_resolvepath() which I think is basically a realpath(3) in the kernel that only does one pathname lookup rather than N. If that really works then it would probably be a boon. -- John Baldwin