Skip to content

Commit 1a0e194

Browse files
committed
Revert "scsi: megaraid_sas: Added support for shared host tagset for cpuhotplug"
This reverts commit 103fbf8. It turns out that it causes long boot-time latencies (to the point of timeouts and failed boots). The cause is the increase in request queues, and a fix for that is queued up for 5.11, but we're reverting this commit that triggered the problem for now. Reported-and-tested-by: John Garry <[email protected]> Reported-and-tested-by: Julia Lawall <[email protected]> Reported-by: Qian Cai <[email protected]> Acked-by: Jens Axboe <[email protected]> Acked-by: Martin K. Petersen <[email protected]> Link: https://lore.kernel.org/linux-scsi/[email protected]/ Link: https://lore.kernel.org/lkml/alpine.DEB.2.22.394.2012081813310.2680@hadrien/ Link: https://lore.kernel.org/linux-block/[email protected]/ Signed-off-by: Linus Torvalds <[email protected]>
1 parent 7d8761b commit 1a0e194

File tree

2 files changed

+13
-55
lines changed

2 files changed

+13
-55
lines changed

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#include <linux/poll.h>
3838
#include <linux/vmalloc.h>
3939
#include <linux/irq_poll.h>
40-
#include <linux/blk-mq-pci.h>
4140

4241
#include <scsi/scsi.h>
4342
#include <scsi/scsi_cmnd.h>
@@ -114,10 +113,6 @@ unsigned int enable_sdev_max_qd;
114113
module_param(enable_sdev_max_qd, int, 0444);
115114
MODULE_PARM_DESC(enable_sdev_max_qd, "Enable sdev max qd as can_queue. Default: 0");
116115

117-
int host_tagset_enable = 1;
118-
module_param(host_tagset_enable, int, 0444);
119-
MODULE_PARM_DESC(host_tagset_enable, "Shared host tagset enable/disable Default: enable(1)");
120-
121116
MODULE_LICENSE("GPL");
122117
MODULE_VERSION(MEGASAS_VERSION);
123118
MODULE_AUTHOR("[email protected]");
@@ -3124,19 +3119,6 @@ megasas_bios_param(struct scsi_device *sdev, struct block_device *bdev,
31243119
return 0;
31253120
}
31263121

3127-
static int megasas_map_queues(struct Scsi_Host *shost)
3128-
{
3129-
struct megasas_instance *instance;
3130-
3131-
instance = (struct megasas_instance *)shost->hostdata;
3132-
3133-
if (shost->nr_hw_queues == 1)
3134-
return 0;
3135-
3136-
return blk_mq_pci_map_queues(&shost->tag_set.map[HCTX_TYPE_DEFAULT],
3137-
instance->pdev, instance->low_latency_index_start);
3138-
}
3139-
31403122
static void megasas_aen_polling(struct work_struct *work);
31413123

31423124
/**
@@ -3445,7 +3427,6 @@ static struct scsi_host_template megasas_template = {
34453427
.eh_timed_out = megasas_reset_timer,
34463428
.shost_attrs = megaraid_host_attrs,
34473429
.bios_param = megasas_bios_param,
3448-
.map_queues = megasas_map_queues,
34493430
.change_queue_depth = scsi_change_queue_depth,
34503431
.max_segment_size = 0xffffffff,
34513432
};
@@ -6827,26 +6808,6 @@ static int megasas_io_attach(struct megasas_instance *instance)
68276808
host->max_lun = MEGASAS_MAX_LUN;
68286809
host->max_cmd_len = 16;
68296810

6830-
/* Use shared host tagset only for fusion adaptors
6831-
* if there are managed interrupts (smp affinity enabled case).
6832-
* Single msix_vectors in kdump, so shared host tag is also disabled.
6833-
*/
6834-
6835-
host->host_tagset = 0;
6836-
host->nr_hw_queues = 1;
6837-
6838-
if ((instance->adapter_type != MFI_SERIES) &&
6839-
(instance->msix_vectors > instance->low_latency_index_start) &&
6840-
host_tagset_enable &&
6841-
instance->smp_affinity_enable) {
6842-
host->host_tagset = 1;
6843-
host->nr_hw_queues = instance->msix_vectors -
6844-
instance->low_latency_index_start;
6845-
}
6846-
6847-
dev_info(&instance->pdev->dev,
6848-
"Max firmware commands: %d shared with nr_hw_queues = %d\n",
6849-
instance->max_fw_cmds, host->nr_hw_queues);
68506811
/*
68516812
* Notify the mid-layer about the new controller
68526813
*/

drivers/scsi/megaraid/megaraid_sas_fusion.c

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -359,29 +359,24 @@ megasas_get_msix_index(struct megasas_instance *instance,
359359
{
360360
int sdev_busy;
361361

362-
/* TBD - if sml remove device_busy in future, driver
363-
* should track counter in internal structure.
364-
*/
365-
sdev_busy = atomic_read(&scmd->device->device_busy);
362+
/* nr_hw_queue = 1 for MegaRAID */
363+
struct blk_mq_hw_ctx *hctx =
364+
scmd->device->request_queue->queue_hw_ctx[0];
365+
366+
sdev_busy = atomic_read(&hctx->nr_active);
366367

367368
if (instance->perf_mode == MR_BALANCED_PERF_MODE &&
368-
sdev_busy > (data_arms * MR_DEVICE_HIGH_IOPS_DEPTH)) {
369+
sdev_busy > (data_arms * MR_DEVICE_HIGH_IOPS_DEPTH))
369370
cmd->request_desc->SCSIIO.MSIxIndex =
370371
mega_mod64((atomic64_add_return(1, &instance->high_iops_outstanding) /
371372
MR_HIGH_IOPS_BATCH_COUNT), instance->low_latency_index_start);
372-
} else if (instance->msix_load_balance) {
373+
else if (instance->msix_load_balance)
373374
cmd->request_desc->SCSIIO.MSIxIndex =
374375
(mega_mod64(atomic64_add_return(1, &instance->total_io_count),
375376
instance->msix_vectors));
376-
} else if (instance->host->nr_hw_queues > 1) {
377-
u32 tag = blk_mq_unique_tag(scmd->request);
378-
379-
cmd->request_desc->SCSIIO.MSIxIndex = blk_mq_unique_tag_to_hwq(tag) +
380-
instance->low_latency_index_start;
381-
} else {
377+
else
382378
cmd->request_desc->SCSIIO.MSIxIndex =
383379
instance->reply_map[raw_smp_processor_id()];
384-
}
385380
}
386381

387382
/**
@@ -961,6 +956,9 @@ megasas_alloc_cmds_fusion(struct megasas_instance *instance)
961956
if (megasas_alloc_cmdlist_fusion(instance))
962957
goto fail_exit;
963958

959+
dev_info(&instance->pdev->dev, "Configured max firmware commands: %d\n",
960+
instance->max_fw_cmds);
961+
964962
/* The first 256 bytes (SMID 0) is not used. Don't add to the cmd list */
965963
io_req_base = fusion->io_request_frames + MEGA_MPI2_RAID_DEFAULT_IO_FRAME_SIZE;
966964
io_req_base_phys = fusion->io_request_frames_phys + MEGA_MPI2_RAID_DEFAULT_IO_FRAME_SIZE;
@@ -1104,9 +1102,8 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
11041102
MR_HIGH_IOPS_QUEUE_COUNT) && cur_intr_coalescing)
11051103
instance->perf_mode = MR_BALANCED_PERF_MODE;
11061104

1107-
dev_info(&instance->pdev->dev, "Performance mode :%s (latency index = %d)\n",
1108-
MEGASAS_PERF_MODE_2STR(instance->perf_mode),
1109-
instance->low_latency_index_start);
1105+
dev_info(&instance->pdev->dev, "Performance mode :%s\n",
1106+
MEGASAS_PERF_MODE_2STR(instance->perf_mode));
11101107

11111108
instance->fw_sync_cache_support = (scratch_pad_1 &
11121109
MR_CAN_HANDLE_SYNC_CACHE_OFFSET) ? 1 : 0;

0 commit comments

Comments
 (0)