Subject: Re: Faster pipes from FreeBSD
To: Jaromr <jdolecek@netbsd.org>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 04/06/2001 08:43:55
hi,

any idea why there are such large variations in the results between runs?

UVM page-loaning should work pretty well for the reduced-copy variation.
it should be possible to avoid copying the data at all in certain
circumstances, but I don't know how often that would work out in practice.

this is a promising beginning.

-Chuck


On Fri, Apr 06, 2001 at 11:26:27AM +0200, Jarom=7Fr Dolecek wrote:
> Hi,
> I've made a stab at porting the FreeBSD sys_pipe() implementation to
> NetBSD (that implementation was written by John S. Dyson). The
> basics are finished, the thing works quite nicely and indeed about
> 1.5-7x faster than out current pipes (wow!). I've tested it very
> lighly on i386 so far, my simple pipe push program gave these results:
>=20
>         OLD                             NEW
> -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=
=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D
> res: buf=3D1024 0s 407449us       res: buf=3D1024 0s 128353us
> res: buf=3D1024 0s 427369us       res: buf=3D1024 0s 62534us
> res: buf=3D1024 0s 424779us       res: buf=3D1024 0s 62550us
> res: buf=3D1024 0s 382265us       res: buf=3D1024 0s 62470us
> res: buf=3D1024 0s 404570us       res: buf=3D1024 0s 225843us
> res: buf=3D1024 0s 399822us       res: buf=3D1024 0s 62518us
> res: buf=3D1024 0s 376706us       res: buf=3D1024 0s 62499us
> res: buf=3D1024 0s 400329us       res: buf=3D1024 0s 81378us
> res: buf=3D1024 0s 389034us       res: buf=3D1024 0s 62491us
> res: buf=3D1024 0s 423899us       res: buf=3D1024 0s 305172us
>=20
> Using some "real" pipe benchmark program would probably
> give more accurate results, these are for orientation only
> (10000 iterations only, 1KB buffer, no checking for valid contents).=20
>=20
> The system with this boots to multiuser and seems to work OK,
> so hopefully there is no problem here.
>=20
> The code does not yet do the direct memory write stuff; I hope it
> would be possible to do it with UVM, since that should yield another
> 30% performance increase, at least according to the comments
> for FreeBSD VM. The NetBSD specific stuff also needs some
> cleanup and improvement before import to our tree (like using
> separate aobj for pipe buffers, avoid #define hacks, ...).  This is work
> in progress, but I think the code is quite cool even in it's current
> form.