Bug 1659146

Summary: Allow drivers to set .force_blk_mq in scsi_host_template to enable per-driver SCSI-MQ usage
Product: Red Hat Enterprise Linux 7 Reporter: Ewan D. Milne <emilne>
Component: kernelAssignee: Ewan D. Milne <emilne>
kernel sub component: Storage Drivers QA Contact: guazhang <guazhang>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: cavery, guazhang, hhei, josalisb, minlei, xiaofwan, xuli, yacao
Version: 7.7   
Target Milestone: pre-dev-freeze   
Target Release: 7.7   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kernel-3.10.0-1017.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-06 12:24:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ewan D. Milne 2018-12-13 16:55:39 UTC
Description of problem:

SCSI drivers that no longer want to support the legacy request path in RHEL7,
or want to force the usage of SCSI-MQ regardless of the global scsi_mod.use_blk_mq
setting need a way to specify in the host template that SCSI-MQ must be used.

Version-Release number of selected component (if applicable): 7.7

Upstream has added a way to specify this:

Author: Ming Lei <ming.lei>
Date:   Tue Mar 13 17:42:41 2018 +0800

    scsi: core: introduce force_blk_mq

Comment 2 Ewan D. Milne 2018-12-13 16:56:41 UTC
Patch is predecessor to changes that will be made to storsvc driver in 7.7

Comment 4 guazhang@redhat.com 2019-01-14 00:13:53 UTC
Hello

How to test it? just add the  scsi_mod.use_blk_mq to host?

Comment 5 Ming Lei 2019-01-14 01:49:36 UTC
We may not need this patch for RHEL7, which is only for addressing virito-scsi's issue wrt. queue mapping vs. CPU hotplug.

However, there isn't such issue on RHEL7 because of the queue mapping/CPU hotplug handling difference.

Comment 6 Ewan D. Milne 2019-01-14 13:19:14 UTC
We will need it for the storvsc driver update in RHEL7.

Comment 7 Ewan D. Milne 2019-01-14 13:43:06 UTC
(In reply to guazhang from comment #4)
> Hello
> 
> How to test it? just add the  scsi_mod.use_blk_mq to host?

Yes.  With the exception of drivers that individually set
use_blk_mq, verify the following:

Boot with scsi_mod.use_blk_mq=N (the default case in RHEL7)
  find /sys | fgrep use_blk_mq (to find the sysfs nodes for the individual
                                scsi_host object settings for instantiated
                                hosts, they should be "0" unless a driver
                                has enabled it explicitly)

Boot with scsi_mod.use_blk_mq=Y
  find /sys | fgrep use_blk_mq -- sysfs nodes for scsi_host objects should be "1"

(i.e. verify that this change does not force SCSI-MQ "on" or "off" unintentionally
for all drivers.)

The actual logic in question that is being changed is in scsi_host_alloc()

-       shost->use_blk_mq = scsi_use_blk_mq && !shost->hostt->disable_blk_mq;
+       shost->use_blk_mq = (scsi_use_blk_mq || shost->hostt->force_blk_mq)
+                           && !shost->hostt->disable_blk_mq;

Drivers can change shost->use_blk_mq after the alloc but before they add the object,
these are the drivers that set use_blk_mq individual by their own module parameters.
(We did this with some drivers earlier in RHEL7 that wished to use SCSI-MQ but we
did not want to turn on SCSI-MQ for all SCSI drivers that might be in use in the kernel.)

Drivers that set use_blk_mq individually are:
  - Infiniband IB/srp -- default module parameter "use_blk_mq" is "Y"
  - lpfc driver - default module parameter "use_blk_mq" is "0"
  - qla2xxx driver - default module parameter "ql2xmqsupport" is "0"

---

The reason for this change now is that storvsc will not be running in non-MQ mode,
and therefore does not need a module option, it can just set the bit in the host
template.

Once the storvsc driver has been updated in RHEL7 to make use of this
functionality to set .force_blk_mq = 1 in the scsi_host_template, it
should always report "use_blk_mq" in the scsi_host object in sysfs
regardless of the scsi_mod.use_blk_mq setting.

Comment 8 Bruno Meneguele 2019-03-08 20:48:35 UTC
Patch(es) committed on kernel-3.10.0-1017.el7

Comment 11 guazhang@redhat.com 2019-05-08 07:32:03 UTC
Hello

RHEL7.7 mq regression test passed. so move to verified.

thanks
guazhang

Comment 13 errata-xmlrpc 2019-08-06 12:24:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:2029