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.com Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
c6bdb6a108
commit
c50ed99cd5
@ -3573,6 +3573,22 @@ _base_get_msix_index(struct MPT3SAS_ADAPTER *ioc,
|
|||||||
return ioc->cpu_msix_table[raw_smp_processor_id()];
|
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
|
* _base_get_high_iops_msix_index - get the msix index of
|
||||||
* high iops queues
|
* 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
|
* reply queues in terms of batch count 16 when outstanding
|
||||||
* IOs on the target device is >=8.
|
* 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)
|
MPT3SAS_DEVICE_HIGH_IOPS_DEPTH)
|
||||||
return base_mod64((
|
return base_mod64((
|
||||||
atomic64_add_return(1, &ioc->high_iops_outstanding) /
|
atomic64_add_return(1, &ioc->high_iops_outstanding) /
|
||||||
|
Loading…
Reference in New Issue
Block a user