Commit c50ed99c authored by Sreekanth Reddy's avatar Sreekanth Reddy Committed by Martin K. Petersen

scsi: mpt3sas: Remove usage of device_busy counter

Remove usage of device_busy counter from driver. Instead of device_busy
counter now driver uses 'nr_active' counter of request_queue to get the
number of inflight request for a LUN.

Link: https://lore.kernel.org/r/20191226111333.26131-10-sreekanth.reddy@broadcom.comSigned-off-by: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c6bdb6a1
......@@ -3573,6 +3573,22 @@ _base_get_msix_index(struct MPT3SAS_ADAPTER *ioc,
return ioc->cpu_msix_table[raw_smp_processor_id()];
}
/**
* _base_sdev_nr_inflight_request -get number of inflight requests
* of a request queue.
* @q: request_queue object
*
* returns number of inflight request of a request queue.
*/
inline unsigned long
_base_sdev_nr_inflight_request(struct request_queue *q)
{
struct blk_mq_hw_ctx *hctx = q->queue_hw_ctx[0];
return atomic_read(&hctx->nr_active);
}
/**
* _base_get_high_iops_msix_index - get the msix index of
* high iops queues
......@@ -3592,7 +3608,7 @@ _base_get_high_iops_msix_index(struct MPT3SAS_ADAPTER *ioc,
* reply queues in terms of batch count 16 when outstanding
* IOs on the target device is >=8.
*/
if (atomic_read(&scmd->device->device_busy) >
if (_base_sdev_nr_inflight_request(scmd->device->request_queue) >
MPT3SAS_DEVICE_HIGH_IOPS_DEPTH)
return base_mod64((
atomic64_add_return(1, &ioc->high_iops_outstanding) /
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment