diff options
| author | Scott Long <scottl@FreeBSD.org> | 2001-08-05 07:26:31 +0000 |
|---|---|---|
| committer | Scott Long <scottl@FreeBSD.org> | 2001-08-05 07:26:31 +0000 |
| commit | 3d04a9d7e3349928688abc0e2d6d84fe5d149d2a (patch) | |
| tree | 756fd851980d0f4ace15ed87994ea04d49781cd5 | |
| parent | 0d3576d9bc5adf0dabbe3500ae0a3da6829bb04e (diff) | |
Notes
| -rw-r--r-- | share/man/man4/aac.4 | 12 | ||||
| -rw-r--r-- | sys/dev/aac/aac.c | 4 | ||||
| -rw-r--r-- | sys/dev/aac/aac_disk.c | 27 |
3 files changed, 26 insertions, 17 deletions
diff --git a/share/man/man4/aac.4 b/share/man/man4/aac.4 index 3988c4d751e7..22167b940017 100644 --- a/share/man/man4/aac.4 +++ b/share/man/man4/aac.4 @@ -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 diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c index 0ea8336ade22..75f01358841a 100644 --- a/sys/dev/aac/aac.c +++ b/sys/dev/aac/aac.c @@ -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 diff --git a/sys/dev/aac/aac_disk.c b/sys/dev/aac/aac_disk.c index a08789f893b4..d8331ea592c4 100644 --- a/sys/dev/aac/aac_disk.c +++ b/sys/dev/aac/aac_disk.c @@ -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); } |
