diff options
| author | Christoph Hellwig <hch@lst.de> | 2014-01-22 09:29:29 -0500 |
|---|---|---|
| committer | Christoph Hellwig <hch@lst.de> | 2014-07-25 07:43:43 -0400 |
| commit | 74665016086615bbaa3fa6f83af410a0a4e029ee (patch) | |
| tree | 9f9d8a692bec91dce69fd303eeedf16c35b41ac6 /drivers/scsi/libsas | |
| parent | 7ae65c0f9646c29432b69580b80e08632e6cd813 (diff) | |
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 'drivers/scsi/libsas')
| -rw-r--r-- | drivers/scsi/libsas/sas_scsi_host.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index 7d02a19419a7..24e477d2ea70 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c | |||
| @@ -813,7 +813,7 @@ retry: | |||
| 813 | spin_unlock_irq(shost->host_lock); | 813 | spin_unlock_irq(shost->host_lock); |
| 814 | 814 | ||
| 815 | SAS_DPRINTK("Enter %s busy: %d failed: %d\n", | 815 | SAS_DPRINTK("Enter %s busy: %d failed: %d\n", |
| 816 | __func__, shost->host_busy, shost->host_failed); | 816 | __func__, atomic_read(&shost->host_busy), shost->host_failed); |
| 817 | /* | 817 | /* |
| 818 | * Deal with commands that still have SAS tasks (i.e. they didn't | 818 | * Deal with commands that still have SAS tasks (i.e. they didn't |
| 819 | * complete via the normal sas_task completion mechanism), | 819 | * complete via the normal sas_task completion mechanism), |
| @@ -858,7 +858,8 @@ out: | |||
| 858 | goto retry; | 858 | goto retry; |
| 859 | 859 | ||
| 860 | SAS_DPRINTK("--- Exit %s: busy: %d failed: %d tries: %d\n", | 860 | SAS_DPRINTK("--- Exit %s: busy: %d failed: %d tries: %d\n", |
| 861 | __func__, shost->host_busy, shost->host_failed, tries); | 861 | __func__, atomic_read(&shost->host_busy), |
| 862 | shost->host_failed, tries); | ||
| 862 | } | 863 | } |
| 863 | 864 | ||
| 864 | enum blk_eh_timer_return sas_scsi_timed_out(struct scsi_cmnd *cmd) | 865 | enum blk_eh_timer_return sas_scsi_timed_out(struct scsi_cmnd *cmd) |
