Subject: Re: Faster pipes, now with uvm_loan()
To: =?iso-8859-1?Q?Jarom=EDr_Dolecek?= <jdolecek@netbsd.org>
From: Frank van der Linden <fvdl@wasabisystems.com>
List: tech-kern
Date: 04/10/2001 20:15:32
On Tue, Apr 10, 2001 at 07:41:22PM +0200, Jaromír Dolecek wrote:
> 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.

Well, it does get performance above FreeBSD for 4k chunks (at least,
according to hbench), but it's just below FreeBSD for sizes up
to 64k. The difference is pretty small overall, though:

bw_pipe:
   4k: 26.787850 (std. 0.273193, 1.02%) [median 26.648000]
   8k: 35.701217 (std. 0.110836, 0.31%) [median 35.704700]
   16k: 41.983250 (std. 0.763147, 1.82%) [median 41.807650]
   32k: 47.274633 (std. 0.321774, 0.68%) [median 47.262700]
   64k: 50.869667 (std. 1.015783, 2.00%) [median 51.357950]
   128k: 25.964033 (std. 0.017668, 0.07%) [median 25.961050]
   256k: 26.270117 (std. 0.031743, 0.12%) [median 26.280550]
   512k: 26.412400 (std. 0.012627, 0.05%) [median 26.415500]
   1m: 26.472817 (std. 0.010618, 0.04%) [median 26.469350]
   2m: 23.368850 (std. 0.268638, 1.15%) [median 23.424100]
   4m: 22.664317 (std. 0.175027, 0.77%) [median 22.674300]


-- 
Frank van der Linden                           fvdl@wasabisystems.com
======================================================================
Quality NetBSD CDs, Support & Service.   http://www.wasabisystems.com/