summaryrefslogtreecommitdiffstats
path: root/sys/dev/aac/aac_disk.c
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2003-02-26 04:46:21 +0000
committerscottl <scottl@FreeBSD.org>2003-02-26 04:46:21 +0000
commitc40528bca41a3712b1bd0ffa7e5a6fa32d26e30c (patch)
tree7222197a22bf396aae6cc5a0fa95eda087593e0d /sys/dev/aac/aac_disk.c
parent6706d1e5c2a49552f197943e1ed3301081c65532 (diff)
downloadFreeBSD-src-c40528bca41a3712b1bd0ffa7e5a6fa32d26e30c.zip
FreeBSD-src-c40528bca41a3712b1bd0ffa7e5a6fa32d26e30c.tar.gz
Bring aac out from under Giant:
- the mutex aac_io_lock protects the main codepaths which handle queues and hardware registers. Only one acquire/release is done in the top-half and the taskqueue. This mutex also applies to the userland command path and CAM data path. - Move the taskqueue to the new Giant-free version. - Register the disk device with DISKFLAG_NOGIANT so the top-half processing runs without Giant. - Move the dynamic command allocator to the worker thread to avoid locking issues with bus_dmamem_alloc(). This gives about 20% improvement in most of my benchmarks.
Diffstat (limited to 'sys/dev/aac/aac_disk.c')
-rw-r--r--sys/dev/aac/aac_disk.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/aac/aac_disk.c b/sys/dev/aac/aac_disk.c
index 1160439..d178e42 100644
--- a/sys/dev/aac/aac_disk.c
+++ b/sys/dev/aac/aac_disk.c
@@ -176,10 +176,13 @@ aac_disk_strategy(struct bio *bp)
}
/* perform accounting */
- devstat_start_transaction(&sc->ad_stats);
/* pass the bio to the controller - it can work out who we are */
+ AAC_LOCK_ACQUIRE(&sc->ad_controller->aac_io_lock);
+ devstat_start_transaction(&sc->ad_stats);
aac_submit_bio(bp);
+ AAC_LOCK_RELEASE(&sc->ad_controller->aac_io_lock);
+
return;
}
@@ -369,7 +372,7 @@ aac_disk_attach(device_t dev)
sc->ad_disk.d_mediasize = (off_t)sc->ad_size * AAC_BLOCK_SIZE;
sc->ad_disk.d_fwsectors = sc->ad_sectors;
sc->ad_disk.d_fwheads = sc->ad_heads;
- disk_create(sc->unit, &sc->ad_disk, 0, NULL, NULL);
+ disk_create(sc->unit, &sc->ad_disk, DISKFLAG_NOGIANT, NULL, NULL);
return (0);
}
OpenPOWER on IntegriCloud