svn commit: r184652 - in head/sys: dev/hwpmc fs/procfs kern

Peter Wemm peter at
Thu Nov 6 07:21:38 PST 2008

On Tue, Nov 4, 2008 at 2:50 PM, John Baldwin <jhb at> wrote:
> On Tuesday 04 November 2008 05:22:47 pm Ivan Voras wrote:
>> 2008/11/4 John Baldwin <jhb at>:
>> > Author: jhb
>> > Date: Tue Nov  4 19:04:01 2008
>> > New Revision: 184652
>> > URL:
>> >
>> > 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 at; peter at; peter at; 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

More information about the svn-src-head mailing list