summaryrefslogtreecommitdiff
path: root/include/scsi/scsi_host.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-01-22 18:29:29 +0400
committerChristoph Hellwig <hch@lst.de>2014-07-25 15:43:43 +0400
commit74665016086615bbaa3fa6f83af410a0a4e029ee (patch)
tree9f9d8a692bec91dce69fd303eeedf16c35b41ac6 /include/scsi/scsi_host.h
parent7ae65c0f9646c29432b69580b80e08632e6cd813 (diff)
downloadlinux-74665016086615bbaa3fa6f83af410a0a4e029ee.tar.xz
scsi: convert host_busy to atomic_t
Avoid taking the host-wide host_lock to check the per-host queue limit. Instead we do an atomic_inc_return early on to grab our slot in the queue, and if necessary decrement it after finishing all checks. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Webb Scales <webbnh@hp.com> Acked-by: Jens Axboe <axboe@kernel.dk> Tested-by: Bart Van Assche <bvanassche@acm.org> Tested-by: Robert Elliott <elliott@hp.com>
Diffstat (limited to 'include/scsi/scsi_host.h')
-rw-r--r--include/scsi/scsi_host.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index b2bc5198b7fb..51f7911b1cbb 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -582,13 +582,9 @@ struct Scsi_Host {
*/
struct blk_queue_tag *bqt;
- /*
- * The following two fields are protected with host_lock;
- * however, eh routines can safely access during eh processing
- * without acquiring the lock.
- */
- unsigned int host_busy; /* commands actually active on low-level */
- unsigned int host_failed; /* commands that failed. */
+ atomic_t host_busy; /* commands actually active on low-level */
+ unsigned int host_failed; /* commands that failed.
+ protected by host_lock */
unsigned int host_eh_scheduled; /* EH scheduled without command */
unsigned int host_no; /* Used for IOCTL_GET_IDLUN, /proc/scsi et al. */