summaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-01-22 14:49:41 +0100
committerChristoph Hellwig <hch@lst.de>2014-07-25 07:39:00 -0400
commit7ae65c0f9646c29432b69580b80e08632e6cd813 (patch)
tree9b4cf362095370eeb5c42d21dc33746d0ba088bd /include/scsi
parentcf68d334dd3a323624f6399dc807d34d8b816391 (diff)
downloadlinux-7ae65c0f9646c29432b69580b80e08632e6cd813.tar.bz2
scsi: convert target_busy to an atomic_t
Avoid taking the host-wide host_lock to check the per-target 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')
-rw-r--r--include/scsi/scsi_device.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 9aa38f7b303b..4e078b63a9e5 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -291,8 +291,8 @@ struct scsi_target {
unsigned int expecting_lun_change:1; /* A device has reported
* a 3F/0E UA, other devices on
* the same target will also. */
- /* commands actually active on LLD. protected by host lock. */
- unsigned int target_busy;
+ /* commands actually active on LLD. */
+ atomic_t target_busy;
/*
* LLDs should set this in the slave_alloc host template callout.
* If set to zero then there is not limit.