Commit f39e5e52 authored by Chandrakanth Patil's avatar Chandrakanth Patil Committed by Martin K. Petersen

scsi: megaraid_sas: Use high IOPS queues based on IO workload

The driver will use round-robin method for IO submission in batches within
the high IOPS queues when the number of in-flight ios on the target device
is larger than 8. Otherwise the driver will use low latency reply queues.
Signed-off-by: default avatarKashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: default avatarChandrakanth Patil <chandrakanth.patil@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent f0b9e7bd
...@@ -2253,6 +2253,8 @@ enum MR_PD_TYPE { ...@@ -2253,6 +2253,8 @@ enum MR_PD_TYPE {
/*Aero performance parameters*/ /*Aero performance parameters*/
#define MR_HIGH_IOPS_QUEUE_COUNT 8 #define MR_HIGH_IOPS_QUEUE_COUNT 8
#define MR_DEVICE_HIGH_IOPS_DEPTH 8
#define MR_HIGH_IOPS_BATCH_COUNT 16
struct megasas_instance { struct megasas_instance {
...@@ -2362,6 +2364,7 @@ struct megasas_instance { ...@@ -2362,6 +2364,7 @@ struct megasas_instance {
atomic_t ldio_outstanding; atomic_t ldio_outstanding;
atomic_t fw_reset_no_pci_access; atomic_t fw_reset_no_pci_access;
atomic64_t total_io_count; atomic64_t total_io_count;
atomic64_t high_iops_outstanding;
struct megasas_instance_template *instancet; struct megasas_instance_template *instancet;
struct tasklet_struct isr_tasklet; struct tasklet_struct isr_tasklet;
......
...@@ -1038,6 +1038,7 @@ MR_BuildRaidContext(struct megasas_instance *instance, ...@@ -1038,6 +1038,7 @@ MR_BuildRaidContext(struct megasas_instance *instance,
stripSize = 1 << raid->stripeShift; stripSize = 1 << raid->stripeShift;
stripe_mask = stripSize-1; stripe_mask = stripSize-1;
io_info->data_arms = raid->rowDataSize;
/* /*
* calculate starting row and stripe, and number of strips and rows * calculate starting row and stripe, and number of strips and rows
......
...@@ -2811,6 +2811,7 @@ megasas_build_ldio_fusion(struct megasas_instance *instance, ...@@ -2811,6 +2811,7 @@ megasas_build_ldio_fusion(struct megasas_instance *instance,
io_info.r1_alt_dev_handle = MR_DEVHANDLE_INVALID; io_info.r1_alt_dev_handle = MR_DEVHANDLE_INVALID;
scsi_buff_len = scsi_bufflen(scp); scsi_buff_len = scsi_bufflen(scp);
io_request->DataLength = cpu_to_le32(scsi_buff_len); io_request->DataLength = cpu_to_le32(scsi_buff_len);
io_info.data_arms = 1;
if (scp->sc_data_direction == DMA_FROM_DEVICE) if (scp->sc_data_direction == DMA_FROM_DEVICE)
io_info.isRead = 1; io_info.isRead = 1;
...@@ -2830,7 +2831,13 @@ megasas_build_ldio_fusion(struct megasas_instance *instance, ...@@ -2830,7 +2831,13 @@ megasas_build_ldio_fusion(struct megasas_instance *instance,
fp_possible = (io_info.fpOkForIo > 0) ? true : false; fp_possible = (io_info.fpOkForIo > 0) ? true : false;
} }
if (instance->msix_load_balance) if (instance->balanced_mode &&
atomic_read(&scp->device->device_busy) >
(io_info.data_arms * MR_DEVICE_HIGH_IOPS_DEPTH))
cmd->request_desc->SCSIIO.MSIxIndex =
mega_mod64((atomic64_add_return(1, &instance->high_iops_outstanding) /
MR_HIGH_IOPS_BATCH_COUNT), instance->low_latency_index_start);
else if (instance->msix_load_balance)
cmd->request_desc->SCSIIO.MSIxIndex = cmd->request_desc->SCSIIO.MSIxIndex =
(mega_mod64(atomic64_add_return(1, &instance->total_io_count), (mega_mod64(atomic64_add_return(1, &instance->total_io_count),
instance->msix_vectors)); instance->msix_vectors));
...@@ -3157,7 +3164,12 @@ megasas_build_syspd_fusion(struct megasas_instance *instance, ...@@ -3157,7 +3164,12 @@ megasas_build_syspd_fusion(struct megasas_instance *instance,
cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle; cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle;
if (instance->msix_load_balance) if (instance->balanced_mode &&
atomic_read(&scmd->device->device_busy) > MR_DEVICE_HIGH_IOPS_DEPTH)
cmd->request_desc->SCSIIO.MSIxIndex =
mega_mod64((atomic64_add_return(1, &instance->high_iops_outstanding) /
MR_HIGH_IOPS_BATCH_COUNT), instance->low_latency_index_start);
else if (instance->msix_load_balance)
cmd->request_desc->SCSIIO.MSIxIndex = cmd->request_desc->SCSIIO.MSIxIndex =
(mega_mod64(atomic64_add_return(1, &instance->total_io_count), (mega_mod64(atomic64_add_return(1, &instance->total_io_count),
instance->msix_vectors)); instance->msix_vectors));
......
...@@ -962,6 +962,7 @@ struct IO_REQUEST_INFO { ...@@ -962,6 +962,7 @@ struct IO_REQUEST_INFO {
u8 pd_after_lb; u8 pd_after_lb;
u16 r1_alt_dev_handle; /* raid 1/10 only */ u16 r1_alt_dev_handle; /* raid 1/10 only */
bool ra_capable; bool ra_capable;
u8 data_arms;
}; };
struct MR_LD_TARGET_SYNC { struct MR_LD_TARGET_SYNC {
......
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