aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ata/ata-all.c
diff options
context:
space:
mode:
authorSøren Schmidt <sos@FreeBSD.org>2004-01-14 21:26:35 +0000
committerSøren Schmidt <sos@FreeBSD.org>2004-01-14 21:26:35 +0000
commit5df3ca789cc76dbb60cafd8eaae720e2a915d114 (patch)
treeab783629baab236719afb9f4d2d98f0bd972552f /sys/dev/ata/ata-all.c
parent1f0bfc3ee5cf6c9f65b1e34ba8d0259d702905c3 (diff)
downloadsrc-5df3ca789cc76dbb60cafd8eaae720e2a915d114.tar.gz
src-5df3ca789cc76dbb60cafd8eaae720e2a915d114.zip
Use UMA instead of plain malloc for getting ATA request storage.
This gives +10% performance on simple tests, so definitly worth it. A few percent more could be had by not using M_ZERO'd alloc's, but we then need to clear fields all over the place to be safe, and that was deemed not worth the trouble (and it makes life dangerous).
Notes
Notes: svn path=/head/; revision=124534
Diffstat (limited to 'sys/dev/ata/ata-all.c')
-rw-r--r--sys/dev/ata/ata-all.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c
index f8bccf18b592..a1946940896d 100644
--- a/sys/dev/ata/ata-all.c
+++ b/sys/dev/ata/ata-all.c
@@ -40,9 +40,10 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <sys/bio.h>
#include <sys/malloc.h>
-#include <sys/sema.h>
#include <sys/sysctl.h>
+#include <sys/sema.h>
#include <sys/taskqueue.h>
+#include <vm/uma.h>
#include <machine/stdarg.h>
#include <machine/resource.h>
#include <machine/bus.h>
@@ -77,6 +78,7 @@ static void ata_init(void);
MALLOC_DEFINE(M_ATA, "ATA generic", "ATA driver generic layer");
struct intr_config_hook *ata_delayed_attach = NULL;
devclass_t ata_devclass;
+uma_zone_t ata_zone;
int ata_wc = 1;
/* local vars */
@@ -997,10 +999,13 @@ ata_init(void)
free(ata_delayed_attach, M_TEMP);
}
- /* Register a handler to flush write caches on shutdown */
+ /* register handler to flush write caches on shutdown */
if ((EVENTHANDLER_REGISTER(shutdown_post_sync, ata_shutdown,
NULL, SHUTDOWN_PRI_DEFAULT)) == NULL)
printf("ata: shutdown event registration failed!\n");
+ /* init our UMA zone for ATA requests */
+ ata_zone = uma_zcreate("ata_request", sizeof(struct ata_request),
+ NULL, NULL, NULL, NULL, 0, 0);
}
SYSINIT(atadev, SI_SUB_DRIVERS, SI_ORDER_SECOND, ata_init, NULL)