aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 0adfb3bce0fd..eb97d2dd3651 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -345,8 +345,7 @@ static void scsi_dec_host_busy(struct Scsi_Host *shost)
345 unsigned long flags; 345 unsigned long flags;
346 346
347 rcu_read_lock(); 347 rcu_read_lock();
348 if (!shost->use_blk_mq) 348 atomic_dec(&shost->host_busy);
349 atomic_dec(&shost->host_busy);
350 if (unlikely(scsi_host_in_recovery(shost))) { 349 if (unlikely(scsi_host_in_recovery(shost))) {
351 spin_lock_irqsave(shost->host_lock, flags); 350 spin_lock_irqsave(shost->host_lock, flags);
352 if (shost->host_failed || shost->host_eh_scheduled) 351 if (shost->host_failed || shost->host_eh_scheduled)
@@ -445,12 +444,7 @@ static inline bool scsi_target_is_busy(struct scsi_target *starget)
445 444
446static inline bool scsi_host_is_busy(struct Scsi_Host *shost) 445static inline bool scsi_host_is_busy(struct Scsi_Host *shost)
447{ 446{
448 /* 447 if (shost->can_queue > 0 &&
449 * blk-mq can handle host queue busy efficiently via host-wide driver
450 * tag allocation
451 */
452
453 if (!shost->use_blk_mq && shost->can_queue > 0 &&
454 atomic_read(&shost->host_busy) >= shost->can_queue) 448 atomic_read(&shost->host_busy) >= shost->can_queue)
455 return true; 449 return true;
456 if (atomic_read(&shost->host_blocked) > 0) 450 if (atomic_read(&shost->host_blocked) > 0)
@@ -1606,10 +1600,7 @@ static inline int scsi_host_queue_ready(struct request_queue *q,
1606 if (scsi_host_in_recovery(shost)) 1600 if (scsi_host_in_recovery(shost))
1607 return 0; 1601 return 0;
1608 1602
1609 if (!shost->use_blk_mq) 1603 busy = atomic_inc_return(&shost->host_busy) - 1;
1610 busy = atomic_inc_return(&shost->host_busy) - 1;
1611 else
1612 busy = 0;
1613 if (atomic_read(&shost->host_blocked) > 0) { 1604 if (atomic_read(&shost->host_blocked) > 0) {
1614 if (busy) 1605 if (busy)
1615 goto starved; 1606 goto starved;
@@ -1625,7 +1616,7 @@ static inline int scsi_host_queue_ready(struct request_queue *q,
1625 "unblocking host at zero depth\n")); 1616 "unblocking host at zero depth\n"));
1626 } 1617 }
1627 1618
1628 if (!shost->use_blk_mq && shost->can_queue > 0 && busy >= shost->can_queue) 1619 if (shost->can_queue > 0 && busy >= shost->can_queue)
1629 goto starved; 1620 goto starved;
1630 if (shost->host_self_blocked) 1621 if (shost->host_self_blocked)
1631 goto starved; 1622 goto starved;
@@ -1711,9 +1702,7 @@ static void scsi_kill_request(struct request *req, struct request_queue *q)
1711 * with the locks as normal issue path does. 1702 * with the locks as normal issue path does.
1712 */ 1703 */
1713 atomic_inc(&sdev->device_busy); 1704 atomic_inc(&sdev->device_busy);
1714 1705 atomic_inc(&shost->host_busy);
1715 if (!shost->use_blk_mq)
1716 atomic_inc(&shost->host_busy);
1717 if (starget->can_queue > 0) 1706 if (starget->can_queue > 0)
1718 atomic_inc(&starget->target_busy); 1707 atomic_inc(&starget->target_busy);
1719 1708