From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 15:21:38 2008 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 A9767106567D; Thu, 6 Nov 2008 15:21:38 +0000 (UTC) (envelope-from peter@wemm.org) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.28]) by mx1.freebsd.org (Postfix) with ESMTP id 3228C8FC19; Thu, 6 Nov 2008 15:21:37 +0000 (UTC) (envelope-from peter@wemm.org) Received: by yw-out-2324.google.com with SMTP id 9so256088ywe.13 for ; Thu, 06 Nov 2008 07:21:37 -0800 (PST) Received: by 10.142.103.2 with SMTP id a2mr506904wfc.164.1225984897294; Thu, 06 Nov 2008 07:21:37 -0800 (PST) Received: by 10.142.255.21 with HTTP; Thu, 6 Nov 2008 07:21:37 -0800 (PST) Message-ID: Date: Thu, 6 Nov 2008 07:21:37 -0800 From: "Peter Wemm" To: "John Baldwin" In-Reply-To: <200811041750.08355.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811041904.mA4J41dL005103@svn.freebsd.org> <9bbcef730811041422x5f1e7bfco45380390c64b3b1c@mail.gmail.com> <200811041750.08355.jhb@freebsd.org> 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-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: Thu, 06 Nov 2008 15:21:38 -0000 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? -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell