summaryrefslogtreecommitdiffstats
path: root/sys/dev/aac/aac_cam.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_cam.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_cam.c')
-rw-r--r--sys/dev/aac/aac_cam.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/aac/aac_cam.c b/sys/dev/aac/aac_cam.c
index e1874be..b7e22b1 100644
--- a/sys/dev/aac/aac_cam.c
+++ b/sys/dev/aac/aac_cam.c
@@ -286,7 +286,9 @@ aac_cam_action(struct cam_sim *sim, union ccb *ccb)
/* Async ops that require communcation with the controller */
+ AAC_LOCK_ACQUIRE(&sc->aac_io_lock);
if (aac_alloc_command(sc, &cm)) {
+ AAC_LOCK_RELEASE(&sc->aac_io_lock);
xpt_freeze_simq(sim, 1);
ccb->ccb_h.status = CAM_REQUEUE_REQ;
xpt_done(ccb);
@@ -402,6 +404,8 @@ aac_cam_action(struct cam_sim *sim, union ccb *ccb)
aac_enqueue_ready(cm);
aac_startio(cm->cm_sc);
+ AAC_LOCK_RELEASE(&sc->aac_io_lock);
+
return;
}
OpenPOWER on IntegriCloud