提交 f664a3cc 编写于 作者: J Jens Axboe

scsi: kill off the legacy IO path

This removes the legacy (non-mq) IO path for SCSI.

Cc: linux-scsi@vger.kernel.org
Acked-by: NHimanshu Madhani <himanshu.madhani@cavium.com>
Reviewed-by: NHannes Reinecke <hare@suse.com>
Tested-by: NMing Lei <ming.lei@redhat.com>
Reviewed-by: NOmar Sandoval <osandov@fb.com>
Acked-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 3a7ea2c4
...@@ -97,11 +97,6 @@ parameters may be changed at runtime by the command ...@@ -97,11 +97,6 @@ parameters may be changed at runtime by the command
allowing boot to proceed. none ignores them, expecting allowing boot to proceed. none ignores them, expecting
user space to do the scan. user space to do the scan.
scsi_mod.use_blk_mq=
[SCSI] use blk-mq I/O path by default
See SCSI_MQ_DEFAULT in drivers/scsi/Kconfig.
Format: <y/n>
sim710= [SCSI,HW] sim710= [SCSI,HW]
See header of drivers/scsi/sim710.c. See header of drivers/scsi/sim710.c.
......
...@@ -50,18 +50,6 @@ config SCSI_NETLINK ...@@ -50,18 +50,6 @@ config SCSI_NETLINK
default n default n
depends on NET depends on NET
config SCSI_MQ_DEFAULT
bool "SCSI: use blk-mq I/O path by default"
default y
depends on SCSI
---help---
This option enables the blk-mq based I/O path for SCSI devices by
default. With this option the scsi_mod.use_blk_mq module/boot
option defaults to Y, without it to N, but it can still be
overridden either way.
If unsure say Y.
config SCSI_PROC_FS config SCSI_PROC_FS
bool "legacy /proc/scsi/ support" bool "legacy /proc/scsi/ support"
depends on SCSI && PROC_FS depends on SCSI && PROC_FS
......
...@@ -3088,12 +3088,6 @@ static ssize_t hwq_mode_store(struct device *dev, ...@@ -3088,12 +3088,6 @@ static ssize_t hwq_mode_store(struct device *dev,
return -EINVAL; return -EINVAL;
} }
if ((mode == HWQ_MODE_TAG) && !shost_use_blk_mq(shost)) {
dev_info(cfgdev, "SCSI-MQ is not enabled, use a different "
"HWQ steering mode.\n");
return -EINVAL;
}
afu->hwq_mode = mode; afu->hwq_mode = mode;
return count; return count;
......
...@@ -222,18 +222,9 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev, ...@@ -222,18 +222,9 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
if (error) if (error)
goto fail; goto fail;
if (shost_use_blk_mq(shost)) { error = scsi_mq_setup_tags(shost);
error = scsi_mq_setup_tags(shost); if (error)
if (error) goto fail;
goto fail;
} else {
shost->bqt = blk_init_tags(shost->can_queue,
shost->hostt->tag_alloc_policy);
if (!shost->bqt) {
error = -ENOMEM;
goto fail;
}
}
if (!shost->shost_gendev.parent) if (!shost->shost_gendev.parent)
shost->shost_gendev.parent = dev ? dev : &platform_bus; shost->shost_gendev.parent = dev ? dev : &platform_bus;
...@@ -309,8 +300,7 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev, ...@@ -309,8 +300,7 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
pm_runtime_disable(&shost->shost_gendev); pm_runtime_disable(&shost->shost_gendev);
pm_runtime_set_suspended(&shost->shost_gendev); pm_runtime_set_suspended(&shost->shost_gendev);
pm_runtime_put_noidle(&shost->shost_gendev); pm_runtime_put_noidle(&shost->shost_gendev);
if (shost_use_blk_mq(shost)) scsi_mq_destroy_tags(shost);
scsi_mq_destroy_tags(shost);
fail: fail:
return error; return error;
} }
...@@ -344,13 +334,8 @@ static void scsi_host_dev_release(struct device *dev) ...@@ -344,13 +334,8 @@ static void scsi_host_dev_release(struct device *dev)
kfree(dev_name(&shost->shost_dev)); kfree(dev_name(&shost->shost_dev));
} }
if (shost_use_blk_mq(shost)) { if (shost->tag_set.tags)
if (shost->tag_set.tags) scsi_mq_destroy_tags(shost);
scsi_mq_destroy_tags(shost);
} else {
if (shost->bqt)
blk_free_tags(shost->bqt);
}
kfree(shost->shost_data); kfree(shost->shost_data);
...@@ -472,8 +457,6 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) ...@@ -472,8 +457,6 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
else else
shost->dma_boundary = 0xffffffff; shost->dma_boundary = 0xffffffff;
shost->use_blk_mq = scsi_use_blk_mq || shost->hostt->force_blk_mq;
device_initialize(&shost->shost_gendev); device_initialize(&shost->shost_gendev);
dev_set_name(&shost->shost_gendev, "host%d", shost->host_no); dev_set_name(&shost->shost_gendev, "host%d", shost->host_no);
shost->shost_gendev.bus = &scsi_bus_type; shost->shost_gendev.bus = &scsi_bus_type;
......
...@@ -3914,7 +3914,7 @@ int lpfc_sli4_scmd_to_wqidx_distr(struct lpfc_hba *phba, ...@@ -3914,7 +3914,7 @@ int lpfc_sli4_scmd_to_wqidx_distr(struct lpfc_hba *phba,
uint32_t tag; uint32_t tag;
uint16_t hwq; uint16_t hwq;
if (cmnd && shost_use_blk_mq(cmnd->device->host)) { if (cmnd) {
tag = blk_mq_unique_tag(cmnd->request); tag = blk_mq_unique_tag(cmnd->request);
hwq = blk_mq_unique_tag_to_hwq(tag); hwq = blk_mq_unique_tag_to_hwq(tag);
......
...@@ -644,8 +644,7 @@ static struct qedi_ctx *qedi_host_alloc(struct pci_dev *pdev) ...@@ -644,8 +644,7 @@ static struct qedi_ctx *qedi_host_alloc(struct pci_dev *pdev)
qedi->max_active_conns = ISCSI_MAX_SESS_PER_HBA; qedi->max_active_conns = ISCSI_MAX_SESS_PER_HBA;
qedi->max_sqes = QEDI_SQ_SIZE; qedi->max_sqes = QEDI_SQ_SIZE;
if (shost_use_blk_mq(shost)) shost->nr_hw_queues = MIN_NUM_CPUS_MSIX(qedi);
shost->nr_hw_queues = MIN_NUM_CPUS_MSIX(qedi);
pci_set_drvdata(pdev, qedi); pci_set_drvdata(pdev, qedi);
......
...@@ -857,13 +857,9 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) ...@@ -857,13 +857,9 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
} }
if (ha->mqenable) { if (ha->mqenable) {
if (shost_use_blk_mq(vha->host)) { tag = blk_mq_unique_tag(cmd->request);
tag = blk_mq_unique_tag(cmd->request); hwq = blk_mq_unique_tag_to_hwq(tag);
hwq = blk_mq_unique_tag_to_hwq(tag); qpair = ha->queue_pair_map[hwq];
qpair = ha->queue_pair_map[hwq];
} else if (vha->vp_idx && vha->qpair) {
qpair = vha->qpair;
}
if (qpair) if (qpair)
return qla2xxx_mqueuecommand(host, cmd, qpair); return qla2xxx_mqueuecommand(host, cmd, qpair);
...@@ -3153,7 +3149,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -3153,7 +3149,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
goto probe_failed; goto probe_failed;
} }
if (ha->mqenable && shost_use_blk_mq(host)) { if (ha->mqenable) {
/* number of hardware queues supported by blk/scsi-mq*/ /* number of hardware queues supported by blk/scsi-mq*/
host->nr_hw_queues = ha->max_qpairs; host->nr_hw_queues = ha->max_qpairs;
...@@ -3265,25 +3261,17 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -3265,25 +3261,17 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
base_vha->mgmt_svr_loop_id, host->sg_tablesize); base_vha->mgmt_svr_loop_id, host->sg_tablesize);
if (ha->mqenable) { if (ha->mqenable) {
bool mq = false;
bool startit = false; bool startit = false;
if (QLA_TGT_MODE_ENABLED()) { if (QLA_TGT_MODE_ENABLED())
mq = true;
startit = false; startit = false;
}
if ((ql2x_ini_mode == QLA2XXX_INI_MODE_ENABLED) && if (ql2x_ini_mode == QLA2XXX_INI_MODE_ENABLED)
shost_use_blk_mq(host)) {
mq = true;
startit = true; startit = true;
}
if (mq) { /* Create start of day qpairs for Block MQ */
/* Create start of day qpairs for Block MQ */ for (i = 0; i < ha->max_qpairs; i++)
for (i = 0; i < ha->max_qpairs; i++) qla2xxx_create_qpair(base_vha, 5, 0, startit);
qla2xxx_create_qpair(base_vha, 5, 0, startit);
}
} }
if (ha->flags.running_gold_fw) if (ha->flags.running_gold_fw)
......
...@@ -780,11 +780,8 @@ MODULE_LICENSE("GPL"); ...@@ -780,11 +780,8 @@ MODULE_LICENSE("GPL");
module_param(scsi_logging_level, int, S_IRUGO|S_IWUSR); module_param(scsi_logging_level, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(scsi_logging_level, "a bit mask of logging levels"); MODULE_PARM_DESC(scsi_logging_level, "a bit mask of logging levels");
#ifdef CONFIG_SCSI_MQ_DEFAULT /* This should go away in the future, it doesn't do anything anymore */
bool scsi_use_blk_mq = true; bool scsi_use_blk_mq = true;
#else
bool scsi_use_blk_mq = false;
#endif
module_param_named(use_blk_mq, scsi_use_blk_mq, bool, S_IWUSR | S_IRUGO); module_param_named(use_blk_mq, scsi_use_blk_mq, bool, S_IWUSR | S_IRUGO);
static int __init init_scsi(void) static int __init init_scsi(void)
......
...@@ -5881,8 +5881,7 @@ static int sdebug_driver_probe(struct device *dev) ...@@ -5881,8 +5881,7 @@ static int sdebug_driver_probe(struct device *dev)
} }
/* Decide whether to tell scsi subsystem that we want mq */ /* Decide whether to tell scsi subsystem that we want mq */
/* Following should give the same answer for each host */ /* Following should give the same answer for each host */
if (shost_use_blk_mq(hpnt)) hpnt->nr_hw_queues = submit_queues;
hpnt->nr_hw_queues = submit_queues;
sdbg_host->shost = hpnt; sdbg_host->shost = hpnt;
*((struct sdebug_host_info **)hpnt->hostdata) = sdbg_host; *((struct sdebug_host_info **)hpnt->hostdata) = sdbg_host;
......
...@@ -308,7 +308,7 @@ enum blk_eh_timer_return scsi_times_out(struct request *req) ...@@ -308,7 +308,7 @@ enum blk_eh_timer_return scsi_times_out(struct request *req)
* error handler. In that case we can return immediately as no * error handler. In that case we can return immediately as no
* further action is required. * further action is required.
*/ */
if (req->q->mq_ops && !blk_mq_mark_complete(req)) if (!blk_mq_mark_complete(req))
return rtn; return rtn;
if (scsi_abort_command(scmd) != SUCCESS) { if (scsi_abort_command(scmd) != SUCCESS) {
set_host_byte(scmd, DID_TIME_OUT); set_host_byte(scmd, DID_TIME_OUT);
......
此差异已折叠。
...@@ -92,7 +92,6 @@ extern void scsi_queue_insert(struct scsi_cmnd *cmd, int reason); ...@@ -92,7 +92,6 @@ extern void scsi_queue_insert(struct scsi_cmnd *cmd, int reason);
extern void scsi_io_completion(struct scsi_cmnd *, unsigned int); extern void scsi_io_completion(struct scsi_cmnd *, unsigned int);
extern void scsi_run_host_queues(struct Scsi_Host *shost); extern void scsi_run_host_queues(struct Scsi_Host *shost);
extern void scsi_requeue_run_queue(struct work_struct *work); extern void scsi_requeue_run_queue(struct work_struct *work);
extern struct request_queue *scsi_old_alloc_queue(struct scsi_device *sdev);
extern struct request_queue *scsi_mq_alloc_queue(struct scsi_device *sdev); extern struct request_queue *scsi_mq_alloc_queue(struct scsi_device *sdev);
extern void scsi_start_queue(struct scsi_device *sdev); extern void scsi_start_queue(struct scsi_device *sdev);
extern int scsi_mq_setup_tags(struct Scsi_Host *shost); extern int scsi_mq_setup_tags(struct Scsi_Host *shost);
......
...@@ -266,10 +266,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, ...@@ -266,10 +266,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
*/ */
sdev->borken = 1; sdev->borken = 1;
if (shost_use_blk_mq(shost)) sdev->request_queue = scsi_mq_alloc_queue(sdev);
sdev->request_queue = scsi_mq_alloc_queue(sdev);
else
sdev->request_queue = scsi_old_alloc_queue(sdev);
if (!sdev->request_queue) { if (!sdev->request_queue) {
/* release fn is set up in scsi_sysfs_device_initialise, so /* release fn is set up in scsi_sysfs_device_initialise, so
* have to free and put manually here */ * have to free and put manually here */
...@@ -280,11 +277,6 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, ...@@ -280,11 +277,6 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
WARN_ON_ONCE(!blk_get_queue(sdev->request_queue)); WARN_ON_ONCE(!blk_get_queue(sdev->request_queue));
sdev->request_queue->queuedata = sdev; sdev->request_queue->queuedata = sdev;
if (!shost_use_blk_mq(sdev->host)) {
blk_queue_init_tags(sdev->request_queue,
sdev->host->cmd_per_lun, shost->bqt,
shost->hostt->tag_alloc_policy);
}
scsi_change_queue_depth(sdev, sdev->host->cmd_per_lun ? scsi_change_queue_depth(sdev, sdev->host->cmd_per_lun ?
sdev->host->cmd_per_lun : 1); sdev->host->cmd_per_lun : 1);
......
...@@ -367,7 +367,6 @@ store_shost_eh_deadline(struct device *dev, struct device_attribute *attr, ...@@ -367,7 +367,6 @@ store_shost_eh_deadline(struct device *dev, struct device_attribute *attr,
static DEVICE_ATTR(eh_deadline, S_IRUGO | S_IWUSR, show_shost_eh_deadline, store_shost_eh_deadline); static DEVICE_ATTR(eh_deadline, S_IRUGO | S_IWUSR, show_shost_eh_deadline, store_shost_eh_deadline);
shost_rd_attr(use_blk_mq, "%d\n");
shost_rd_attr(unique_id, "%u\n"); shost_rd_attr(unique_id, "%u\n");
shost_rd_attr(cmd_per_lun, "%hd\n"); shost_rd_attr(cmd_per_lun, "%hd\n");
shost_rd_attr(can_queue, "%hd\n"); shost_rd_attr(can_queue, "%hd\n");
...@@ -386,6 +385,13 @@ show_host_busy(struct device *dev, struct device_attribute *attr, char *buf) ...@@ -386,6 +385,13 @@ show_host_busy(struct device *dev, struct device_attribute *attr, char *buf)
} }
static DEVICE_ATTR(host_busy, S_IRUGO, show_host_busy, NULL); static DEVICE_ATTR(host_busy, S_IRUGO, show_host_busy, NULL);
static ssize_t
show_use_blk_mq(struct device *dev, struct device_attribute *attr, char *buf)
{
return sprintf(buf, "1\n");
}
static DEVICE_ATTR(use_blk_mq, S_IRUGO, show_use_blk_mq, NULL);
static struct attribute *scsi_sysfs_shost_attrs[] = { static struct attribute *scsi_sysfs_shost_attrs[] = {
&dev_attr_use_blk_mq.attr, &dev_attr_use_blk_mq.attr,
&dev_attr_unique_id.attr, &dev_attr_unique_id.attr,
......
...@@ -8100,12 +8100,6 @@ int ufshcd_alloc_host(struct device *dev, struct ufs_hba **hba_handle) ...@@ -8100,12 +8100,6 @@ int ufshcd_alloc_host(struct device *dev, struct ufs_hba **hba_handle)
goto out_error; goto out_error;
} }
/*
* Do not use blk-mq at this time because blk-mq does not support
* runtime pm.
*/
host->use_blk_mq = false;
hba = shost_priv(host); hba = shost_priv(host);
hba->host = host; hba->host = host;
hba->dev = dev; hba->dev = dev;
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include <linux/blk-mq.h> #include <linux/blk-mq.h>
#include <scsi/scsi.h> #include <scsi/scsi.h>
struct request_queue;
struct block_device; struct block_device;
struct completion; struct completion;
struct module; struct module;
...@@ -22,7 +21,6 @@ struct scsi_target; ...@@ -22,7 +21,6 @@ struct scsi_target;
struct Scsi_Host; struct Scsi_Host;
struct scsi_host_cmd_pool; struct scsi_host_cmd_pool;
struct scsi_transport_template; struct scsi_transport_template;
struct blk_queue_tags;
/* /*
...@@ -547,14 +545,8 @@ struct Scsi_Host { ...@@ -547,14 +545,8 @@ struct Scsi_Host {
struct scsi_host_template *hostt; struct scsi_host_template *hostt;
struct scsi_transport_template *transportt; struct scsi_transport_template *transportt;
/* /* Area to keep a shared tag map */
* Area to keep a shared tag map (if needed, will be struct blk_mq_tag_set tag_set;
* NULL if not).
*/
union {
struct blk_queue_tag *bqt;
struct blk_mq_tag_set tag_set;
};
atomic_t host_busy; /* commands actually active on low-level */ atomic_t host_busy; /* commands actually active on low-level */
atomic_t host_blocked; atomic_t host_blocked;
...@@ -648,7 +640,6 @@ struct Scsi_Host { ...@@ -648,7 +640,6 @@ struct Scsi_Host {
/* The controller does not support WRITE SAME */ /* The controller does not support WRITE SAME */
unsigned no_write_same:1; unsigned no_write_same:1;
unsigned use_blk_mq:1;
unsigned use_cmd_list:1; unsigned use_cmd_list:1;
/* Host responded with short (<36 bytes) INQUIRY result */ /* Host responded with short (<36 bytes) INQUIRY result */
...@@ -742,11 +733,6 @@ static inline int scsi_host_in_recovery(struct Scsi_Host *shost) ...@@ -742,11 +733,6 @@ static inline int scsi_host_in_recovery(struct Scsi_Host *shost)
shost->tmf_in_progress; shost->tmf_in_progress;
} }
static inline bool shost_use_blk_mq(struct Scsi_Host *shost)
{
return shost->use_blk_mq;
}
extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *); extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *);
extern void scsi_flush_work(struct Scsi_Host *); extern void scsi_flush_work(struct Scsi_Host *);
......
...@@ -23,19 +23,15 @@ static inline struct scsi_cmnd *scsi_host_find_tag(struct Scsi_Host *shost, ...@@ -23,19 +23,15 @@ static inline struct scsi_cmnd *scsi_host_find_tag(struct Scsi_Host *shost,
int tag) int tag)
{ {
struct request *req = NULL; struct request *req = NULL;
u16 hwq;
if (tag == SCSI_NO_TAG) if (tag == SCSI_NO_TAG)
return NULL; return NULL;
if (shost_use_blk_mq(shost)) { hwq = blk_mq_unique_tag_to_hwq(tag);
u16 hwq = blk_mq_unique_tag_to_hwq(tag); if (hwq < shost->tag_set.nr_hw_queues) {
req = blk_mq_tag_to_rq(shost->tag_set.tags[hwq],
if (hwq < shost->tag_set.nr_hw_queues) { blk_mq_unique_tag_to_tag(tag));
req = blk_mq_tag_to_rq(shost->tag_set.tags[hwq],
blk_mq_unique_tag_to_tag(tag));
}
} else {
req = blk_map_queue_find_tag(shost->bqt, tag);
} }
if (!req) if (!req)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册