Subject: Re: Disk-level Transaction Clustering
To: Chris Jepeway <jepeway@blasted-heath.com>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-perform
Date: 09/07/2002 09:32:55
On Sat, Sep 07, 2002 at 02:42:19AM -0400, Chris Jepeway wrote:

 > Further info and code/patches at
 > 
 >     http://www.blasted-heath.com/nbsd/cluster/

This is pretty cool stuff, but I have some suggestions on how to make
it better :-)

You really don't want to use a VM map to make the clusters.  This can have
painful side-effects on some architectures, esp. since you are using
kmappings ... this is basically not going to work on any platform which has
a virtually-indexed cache.

Instead, I suggest using uios to describe the clusters.  Make a flag
called B_UIO for the buf structure, and when that is set, b_data points
to a uio structure.  When you build a cluster, allocate a uio and an iovec
array (maybe always allocate an iovec array large enough to handle up to
some max_cluster requests).

...then modify the SCSI HBA drivers to use bus_dmamap_load_uio instead
of bus_dmamap_load when they see B_UIO.  Note that there is already some
#if 0'd code for this in some HBA drivers (historical reasons).

It would also be nice if the building of clusters were hidden inside the
BUFQ interface.  I suggest adding a new flag when the bufq is allocated,
BUFQ_CLUSTER, or something.

Now, for devices which aren't using bus_dma, we could just avoid setting
BUFQ_CLUSTER in those cases.  They won't get the benefit of clustering, but
they will also continue to work.

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>