Once again throw out the calculation of si_iosize_max and set it to 64K.

Although it can go higher, it is not safe to so do on arrays with many
members.  Compromise by adding a tunable, "hw.aac.iosize_max" that can be
set at boottime.  Also document in the aac(4) manpage.

MFC after:	4 weeks
This commit is contained in:
Scott Long 2001-08-05 07:26:31 +00:00
parent 0d3576d9bc
commit 3d04a9d7e3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=81154
3 changed files with 26 additions and 17 deletions

View File

@ -100,6 +100,18 @@ disk/container interface
.It Pa /boot/kernel/aac.ko
aac loadable module
.El
.Sh TUNING
The read-only sysctl
.Va hw.aac.iosize_max
defautls to 65536 and may be set at boot time to another value via
.Xr loader 8 .
This value determines the maximum data transfer size allowed
to/from an array. Setting it higher will result in better performance,
especially for large sequential access patterns. BEWARE: internal limitations
of the card limit this value to 64K for arrays with many members. While it
may be safe to raise this value, do so AT YOUR OWN RISK. Note also that
performance peaks at a value of 96K, and drops off dramatically at 128K, due
to other limitations of the card.
.Sh DIAGNOSTICS
Compiling with
.Dv AAC_DEBUG

View File

@ -40,6 +40,7 @@
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
#include <dev/aac/aac_compat.h>
@ -183,6 +184,9 @@ static struct cdevsw aac_cdevsw = {
0, /* flags */
};
/* sysctl node */
SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD, 0, "AAC driver parameters");
/******************************************************************************
******************************************************************************
Device Interface

View File

@ -34,6 +34,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
#include <dev/aac/aac_compat.h>
#include <sys/bus.h>
@ -101,6 +102,14 @@ static driver_t aac_disk_driver = {
DRIVER_MODULE(aacd, aac, aac_disk_driver, aac_disk_devclass, 0, 0);
/* sysctl tunables */
static unsigned int aac_iosize_max = 65536; /* due to limits of the card */
TUNABLE_INT("hw.aac.iosize_max", &aac_iosize_max);
SYSCTL_DECL(_hw_aac);
SYSCTL_UINT(_hw_aac, OID_AUTO, iosize_max, CTLFLAG_RD, &aac_iosize_max, 0,
"Max I/O size per transfer to an array");
/******************************************************************************
* Handle open from generic layer.
*
@ -215,8 +224,6 @@ static int
aac_disk_attach(device_t dev)
{
struct aac_disk *sc = (struct aac_disk *)device_get_softc(dev);
int sgspace;
int maxsg;
debug_called(4);
@ -259,21 +266,7 @@ aac_disk_attach(device_t dev)
disks_registered++;
#endif
/*
* We can calculate the maximum number of s/g entries based on the size of
* the FIB and the command structures packed within it.
*/
sgspace = (sizeof(struct aac_fib) - sizeof(struct aac_fib_header) -
imax(sizeof(struct aac_blockwrite),
sizeof(struct aac_blockread)));
maxsg = (sgspace - sizeof(struct aac_sg_table)) /
sizeof(struct aac_sg_entry);
/*
* set the maximum I/O size to the theoretical worst maximum allowed by the
* S/G list size
*/
sc->ad_dev_t->si_iosize_max = (maxsg - 1) * PAGE_SIZE;
sc->ad_dev_t->si_iosize_max = aac_iosize_max;
return (0);
}