svn commit: r274017 - head/sys/kern

Poul-Henning Kamp phk at phk.freebsd.dk
Tue Nov 4 07:25:03 UTC 2014


--------
In message <20141104053520.GA4032 at dft-labs.eu>, Mateusz Guzik writes:
>On Mon, Nov 03, 2014 at 07:35:56PM +0000, Poul-Henning Kamp wrote:
>> --------
>> In message <20141104045159.E1605 at besplex.bde.org>, Bruce Evans writes:
>> 
>> >This optimization is probably minor, but reminds me of other syscalls
>> >that would benefit using a single largish allocation up front:
>> >- all vfs calls that start with namei().  They allocate PATH_MAX (1K)
>> >   bytes and more.  An 8K stack has plently to spare after allocating
>> >   1K.  However, if malloc() is used then the PATH_MAX limit shouldn't
>> >   exist.   Only a limit to prevent denial of service is needed.
>> 
>> We should actually roll a new rev of all syscalls which take a path
>> and have them pass strlen(path)+1 into the kernel.
>> 
>> That would allow both precise allocation and faster copyin, followed
>> by a check that the last byte is (still) a NUL.
>> 
>
>I think we can speed up things on amd64 no problem without affecting
>userspace.

I think from a design point of view it makes much more sense to let
userland do as much work as possible before we enter the kernel,
rather than complicate the kernel with "oops we got a page fault"
handling.


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the svn-src-all mailing list