Subject: Re: Faster pipes from FreeBSD
To: None <tech-kern@netbsd.org>
From: Jaromír <jdolecek@netbsd.org>
List: tech-kern
Date: 04/11/2001 23:27:30
Hi again,
I played with changes to use 64KB chunks when transferring data
for buffers > 64KB. That indeed seem to help much. On my PIII
machine, the performance drop is now only about 20% instead of 45%
for 128KB transfer buffer compared with 64KB one.
The code is currently not quite tuned, so it's possible there
is still some space for improvement. However, I get slighly better
performance than before for 64KB transfer buffer case, so at least
the code doesn't make things worse.

I've put in also minor optimization - the array for list of vmpages
is allocated only once commonly and re-used as necessary, similarily
to the kva optimization.  Power-of-two malloc did already pretty
good work there, so this didn't have any visible effect on any of
my two test machines. Or perhaps the effect was consumed by
the new chunk code :)

I also played with entering the loaned pages via pmap_kenter_pa()/
pmap_kremove() instead of pmap_enter().  This was quite a lot slower
that the current way, at least on 386DX (like 70% of version with
pmap_enter()). My understanding of (U)VM/i386 is too limited to tell
why.

As I'm going through the code, it seems the logic could be
quite a lot simplified if support for bidirectional pipes would
be dropped entirely. I didn't tried to do so yet, though.

The current version with the 64NK chunking is at:
	ftp://ftp.netbsd.org/pub/NetBSD/misc/jdolecek/newpipe-1.4.tgz

Note that not only kern/sys_pipe.c, but also sys/pipe.h was changed
this time.

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>      http://www.ics.muni.cz/~dolecek/
NetBSD - just plain best OS! -=<>=- Got spare MCA cards or docs? Hand me them!