scsi: convert host_busy to atomic_t
authorChristoph Hellwig <hch@lst.de>
Wed, 22 Jan 2014 14:29:29 +0000 (15:29 +0100)
committerChristoph Hellwig <hch@lst.de>
Fri, 25 Jul 2014 11:43:43 +0000 (07:43 -0400)
commit74665016086615bbaa3fa6f83af410a0a4e029ee
tree9f9d8a692bec91dce69fd303eeedf16c35b41ac6
parent7ae65c0f9646c29432b69580b80e08632e6cd813
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>
drivers/scsi/advansys.c
drivers/scsi/libiscsi.c
drivers/scsi/libsas/sas_scsi_host.c
drivers/scsi/qlogicpti.c
drivers/scsi/scsi.c
drivers/scsi/scsi_error.c
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_sysfs.c
include/scsi/scsi_host.h