Subject: Re: Faster pipes, now with uvm_loan()
To: Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
From: Jaromír <jdolecek@netbsd.org>
List: tech-kern
Date: 04/10/2001 19:41:22
I've put in another optimization - if we are not above kva limit,
the kva used for loaned memory is not freed, but carried over
and reused for next iteration. FreeBSD direct write version used
this technique, too. This is probably reason why they were still
faster compared against newpipe-1.1

This improved the performance for my 386DX to 10.6 MB/sec i.e. ~2
times faster compared with non-optimized uvm_loan() variant. For
PIII, the bandwidth according to lmbench/bw_pipe and hbench/bw_pipe
with 64KB buffer is ~670 MB/sec, i.e. the optimization gained like
next 18% on PIII.
This would maybe bump NetBSD/i386 pipe performance for pipes with
8-64KB buffer above FreeBSD :) It almost looks like too much; however,
none of tests I've done so far found any data corruption.

The code is on
	ftp://ftp.NetBSD.org/pub/NetBSD/misc/jdolecek/newpipe-1.3.tgz
Again, the only changed file is kern/sys_pipe.c.

However, I still see the performance drop for bigger buffers - with
128KB buffer, I see pipe bandwidth like 370 MB/sec with hbench/bw_pipe,
for 256KB buffer about 300 MB/sec. I din't tried to transfer the buffer
by 64KB chunks yet; going to try it out shortly.

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!