* [PATCH v4 00/10] blk: refactor queue affinity helpers
@ 2024-11-13 14:26 Daniel Wagner
2024-11-13 14:26 ` [PATCH v4 01/10] driver core: bus: add irq_get_affinity callback to bus_type Daniel Wagner
` (9 more replies)
0 siblings, 10 replies; 25+ messages in thread
From: Daniel Wagner @ 2024-11-13 14:26 UTC (permalink / raw)
To: Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin, Jason Wang,
Xuan Zhuo, Eugenio Pérez, Martin K. Petersen, Keith Busch,
Christoph Hellwig, Sagi Grimberg, John Garry, Greg Kroah-Hartman,
Hannes Reinecke
Cc: linux-block, linux-kernel, linux-pci, virtualization, linux-scsi,
megaraidlinux.pdl, mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl,
storagedev, linux-nvme, Daniel Wagner
Baes on Johns' idea, I added another irq_get_affinity callback to struct
device_driver and made blk_mq_hctx_map_queues to try that one first. With
this I could also replace the open coded queue mapping in hisi_sas v2.
Besides this change I fixed couple of typos and also addressed John
feedback in hisi_sas v3.
Original cover letter:
These patches were part of 'honor isolcpus configuration' [1] series. To
simplify the review process I decided to send this as separate series
because I think it's a nice cleanup independent of the isolcpus feature.
Signed-off-by: Daniel Wagner <wagi@kernel.org>
---
Changes in v4:
- added irq_get_affinity callback to struct device_driver
- hisi_sas use dev pointer directly from hisi_hba.
- blk_mq_hctx_map_queues: ty irq_get_affinity callback
from device_driver first then from bus_type
- collected tags
- fixed typos
- Link to v3: https://lore.kernel.org/r/20241112-refactor-blk-affinity-helpers-v3-0-573bfca0cbd8@kernel.org
Changes in v3:
- dropped the additinal argument in blk_mq_hctx_map_queues.
leave open coded version in hisi_sas_v2.
- splitted "blk-mp: introduce blk_mq_hctx_map_queues" patch into
three patches.
- dropped local variable in pci_device_irq_get_affinity
- Link to v2: https://lore.kernel.org/r/20241111-refactor-blk-affinity-helpers-v2-0-f360ddad231a@kernel.org
Changes in v2:
- added new callback to struct bus_type and call directly the affinity
helpers from there.
- Link to v1: https://lore.kernel.org/r/20240913-refactor-blk-affinity-helpers-v1-0-8e058f77af12@suse.de
Changes in v1:
- renamed blk_mq_dev_map_queues to blk_mq_hctx_map_queues
- squased 'virito: add APIs for retrieving vq affinity' into
'blk-mq: introduce blk_mq_hctx_map_queues'
- moved hisi_sas changed into a new patch
- hisi_sas use define instead of hard coded value
- moved helpers into their matching subsystem, removed
blk-mq-pci and blk-mq-virtio files
- fix spelling/typos
- fixed long lines in docu (yep new lines in brief descriptions are
supported, tested ti)
- based on the first part of
[1] https://lore.kernel.org/all/20240806-isolcpus-io-queues-v3-0-da0eecfeaf8b@suse.de
---
Daniel Wagner (10):
driver core: bus: add irq_get_affinity callback to bus_type
driver core: add irq_get_affinity callback device_driver
PCI: hookup irq_get_affinity callback
virtio: hookup irq_get_affinity callback
blk-mq: introduce blk_mq_hctx_map_queues
scsi: replace blk_mq_pci_map_queues with blk_mq_hctx_map_queues
scsi: hisi_sas: use blk_mq_hctx_map_queues to map queues
nvme: replace blk_mq_pci_map_queues with blk_mq_hctx_map_queues
virtio: blk/scsi: replace blk_mq_virtio_map_queues with blk_mq_hctx_map_queues
blk-mq: remove unused queue mapping helpers
block/Makefile | 2 --
block/blk-mq-cpumap.c | 43 +++++++++++++++++++++++++++++
block/blk-mq-pci.c | 46 -------------------------------
block/blk-mq-virtio.c | 46 -------------------------------
drivers/block/virtio_blk.c | 4 +--
drivers/nvme/host/fc.c | 1 -
drivers/nvme/host/pci.c | 3 +-
drivers/pci/pci-driver.c | 14 ++++++++++
drivers/scsi/fnic/fnic_main.c | 3 +-
drivers/scsi/hisi_sas/hisi_sas.h | 1 -
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 22 +++++++--------
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 4 +--
drivers/scsi/megaraid/megaraid_sas_base.c | 3 +-
drivers/scsi/mpi3mr/mpi3mr.h | 1 -
drivers/scsi/mpi3mr/mpi3mr_os.c | 2 +-
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 3 +-
drivers/scsi/pm8001/pm8001_init.c | 2 +-
drivers/scsi/pm8001/pm8001_sas.h | 1 -
drivers/scsi/qla2xxx/qla_nvme.c | 3 +-
drivers/scsi/qla2xxx/qla_os.c | 4 +--
drivers/scsi/smartpqi/smartpqi_init.c | 7 ++---
drivers/scsi/virtio_scsi.c | 3 +-
drivers/virtio/virtio.c | 19 +++++++++++++
include/linux/blk-mq-pci.h | 11 --------
include/linux/blk-mq-virtio.h | 11 --------
include/linux/blk-mq.h | 2 ++
include/linux/device/bus.h | 3 ++
include/linux/device/driver.h | 3 ++
28 files changed, 112 insertions(+), 155 deletions(-)
---
base-commit: c9af98a7e8af266bae73e9d662b8341da1ec5824
change-id: 20240912-refactor-blk-affinity-helpers-7089b95b4b10
Best regards,
--
Daniel Wagner <wagi@kernel.org>
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH v4 01/10] driver core: bus: add irq_get_affinity callback to bus_type
2024-11-13 14:26 [PATCH v4 00/10] blk: refactor queue affinity helpers Daniel Wagner
@ 2024-11-13 14:26 ` Daniel Wagner
2024-11-14 1:45 ` Ming Lei
2024-11-13 14:26 ` [PATCH v4 02/10] driver core: add irq_get_affinity callback device_driver Daniel Wagner
` (8 subsequent siblings)
9 siblings, 1 reply; 25+ messages in thread
From: Daniel Wagner @ 2024-11-13 14:26 UTC (permalink / raw)
To: Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin, Jason Wang,
Xuan Zhuo, Eugenio Pérez, Martin K. Petersen, Keith Busch,
Christoph Hellwig, Sagi Grimberg, John Garry, Greg Kroah-Hartman,
Hannes Reinecke
Cc: linux-block, linux-kernel, linux-pci, virtualization, linux-scsi,
megaraidlinux.pdl, mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl,
storagedev, linux-nvme, Daniel Wagner
Introducing a callback in struct bus_type so that a subsystem
can hook up the getters directly. This approach avoids exposing
random getters in any subsystems APIs.
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
---
include/linux/device/bus.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/linux/device/bus.h b/include/linux/device/bus.h
index cdc4757217f9bb4b36b5c3b8a48bab45737e44c5..b18658bce2c3819fc1cbeb38fb98391d56ec3317 100644
--- a/include/linux/device/bus.h
+++ b/include/linux/device/bus.h
@@ -48,6 +48,7 @@ struct fwnode_handle;
* will never get called until they do.
* @remove: Called when a device removed from this bus.
* @shutdown: Called at shut-down time to quiesce the device.
+ * @irq_get_affinity: Get IRQ affinity mask for the device on this bus.
*
* @online: Called to put the device back online (after offlining it).
* @offline: Called to put the device offline for hot-removal. May fail.
@@ -87,6 +88,8 @@ struct bus_type {
void (*sync_state)(struct device *dev);
void (*remove)(struct device *dev);
void (*shutdown)(struct device *dev);
+ const struct cpumask *(*irq_get_affinity)(struct device *dev,
+ unsigned int irq_vec);
int (*online)(struct device *dev);
int (*offline)(struct device *dev);
--
2.47.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v4 02/10] driver core: add irq_get_affinity callback device_driver
2024-11-13 14:26 [PATCH v4 00/10] blk: refactor queue affinity helpers Daniel Wagner
2024-11-13 14:26 ` [PATCH v4 01/10] driver core: bus: add irq_get_affinity callback to bus_type Daniel Wagner
@ 2024-11-13 14:26 ` Daniel Wagner
2024-11-14 1:52 ` Ming Lei
2024-11-13 14:26 ` [PATCH v4 03/10] PCI: hookup irq_get_affinity callback Daniel Wagner
` (7 subsequent siblings)
9 siblings, 1 reply; 25+ messages in thread
From: Daniel Wagner @ 2024-11-13 14:26 UTC (permalink / raw)
To: Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin, Jason Wang,
Xuan Zhuo, Eugenio Pérez, Martin K. Petersen, Keith Busch,
Christoph Hellwig, Sagi Grimberg, John Garry, Greg Kroah-Hartman,
Hannes Reinecke
Cc: linux-block, linux-kernel, linux-pci, virtualization, linux-scsi,
megaraidlinux.pdl, mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl,
storagedev, linux-nvme, Daniel Wagner
Introducing a callback in struct device_driver so that a device driver
can hook up the getters directly. This approach avoids exposing random
getters in drivers.
Signed-off-by: Daniel Wagner <wagi@kernel.org>
---
include/linux/device/driver.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/linux/device/driver.h b/include/linux/device/driver.h
index 5c04b8e3833b995f9fd4d65b8732b3dfce2eba7e..0d1aee423f6c076ae102bdd0536233c259947fac 100644
--- a/include/linux/device/driver.h
+++ b/include/linux/device/driver.h
@@ -74,6 +74,7 @@ enum probe_type {
* @suspend: Called to put the device to sleep mode. Usually to a
* low power state.
* @resume: Called to bring a device from sleep mode.
+ * @irq_get_affinity: Get IRQ affinity mask for the device.
* @groups: Default attributes that get created by the driver core
* automatically.
* @dev_groups: Additional attributes attached to device instance once
@@ -112,6 +113,8 @@ struct device_driver {
void (*shutdown) (struct device *dev);
int (*suspend) (struct device *dev, pm_message_t state);
int (*resume) (struct device *dev);
+ const struct cpumask *(*irq_get_affinity)(struct device *dev,
+ unsigned int irq_vec);
const struct attribute_group **groups;
const struct attribute_group **dev_groups;
--
2.47.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v4 03/10] PCI: hookup irq_get_affinity callback
2024-11-13 14:26 [PATCH v4 00/10] blk: refactor queue affinity helpers Daniel Wagner
2024-11-13 14:26 ` [PATCH v4 01/10] driver core: bus: add irq_get_affinity callback to bus_type Daniel Wagner
2024-11-13 14:26 ` [PATCH v4 02/10] driver core: add irq_get_affinity callback device_driver Daniel Wagner
@ 2024-11-13 14:26 ` Daniel Wagner
2024-11-14 1:53 ` Ming Lei
2024-11-13 14:26 ` [PATCH v4 04/10] virtio: " Daniel Wagner
` (6 subsequent siblings)
9 siblings, 1 reply; 25+ messages in thread
From: Daniel Wagner @ 2024-11-13 14:26 UTC (permalink / raw)
To: Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin, Jason Wang,
Xuan Zhuo, Eugenio Pérez, Martin K. Petersen, Keith Busch,
Christoph Hellwig, Sagi Grimberg, John Garry, Greg Kroah-Hartman,
Hannes Reinecke
Cc: linux-block, linux-kernel, linux-pci, virtualization, linux-scsi,
megaraidlinux.pdl, mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl,
storagedev, linux-nvme, Daniel Wagner
struct bus_type has a new callback for retrieving the IRQ affinity for a
device. Hook this callback up for PCI based devices.
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
---
drivers/pci/pci-driver.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 35270172c833186995aebdda6f95ab3ffd7c67a0..a9cb0e3ad2e6eca58c34683303b1242228e96909 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -1670,6 +1670,19 @@ static void pci_dma_cleanup(struct device *dev)
iommu_device_unuse_default_domain(dev);
}
+/**
+ * pci_device_irq_get_affinity - get IRQ affinity mask for device
+ * @dev: ptr to dev structure
+ * @irq_vec: interrupt vector number
+ *
+ * Return the CPU affinity mask for @dev and @irq_vec.
+ */
+static const struct cpumask *pci_device_irq_get_affinity(struct device *dev,
+ unsigned int irq_vec)
+{
+ return pci_irq_get_affinity(to_pci_dev(dev), irq_vec);
+}
+
const struct bus_type pci_bus_type = {
.name = "pci",
.match = pci_bus_match,
@@ -1677,6 +1690,7 @@ const struct bus_type pci_bus_type = {
.probe = pci_device_probe,
.remove = pci_device_remove,
.shutdown = pci_device_shutdown,
+ .irq_get_affinity = pci_device_irq_get_affinity,
.dev_groups = pci_dev_groups,
.bus_groups = pci_bus_groups,
.drv_groups = pci_drv_groups,
--
2.47.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v4 04/10] virtio: hookup irq_get_affinity callback
2024-11-13 14:26 [PATCH v4 00/10] blk: refactor queue affinity helpers Daniel Wagner
` (2 preceding siblings ...)
2024-11-13 14:26 ` [PATCH v4 03/10] PCI: hookup irq_get_affinity callback Daniel Wagner
@ 2024-11-13 14:26 ` Daniel Wagner
2024-11-14 1:54 ` Ming Lei
2024-11-13 14:26 ` [PATCH v4 05/10] blk-mq: introduce blk_mq_hctx_map_queues Daniel Wagner
` (5 subsequent siblings)
9 siblings, 1 reply; 25+ messages in thread
From: Daniel Wagner @ 2024-11-13 14:26 UTC (permalink / raw)
To: Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin, Jason Wang,
Xuan Zhuo, Eugenio Pérez, Martin K. Petersen, Keith Busch,
Christoph Hellwig, Sagi Grimberg, John Garry, Greg Kroah-Hartman,
Hannes Reinecke
Cc: linux-block, linux-kernel, linux-pci, virtualization, linux-scsi,
megaraidlinux.pdl, mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl,
storagedev, linux-nvme, Daniel Wagner
struct bus_type has a new callback for retrieving the IRQ affinity for a
device. Hook this callback up for virtio based devices.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
---
drivers/virtio/virtio.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index b9095751e43bb7db5fc991b0cc0979d2e86f7b9b..4ca6ec84cb092eac7ddf4b86b4eacac099b480cf 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -377,6 +377,24 @@ static void virtio_dev_remove(struct device *_d)
of_node_put(dev->dev.of_node);
}
+/**
+ * virtio_irq_get_affinity - get IRQ affinity mask for device
+ * @_d: ptr to dev structure
+ * @irq_vec: interrupt vector number
+ *
+ * Return the CPU affinity mask for @_d and @irq_vec.
+ */
+static const struct cpumask *virtio_irq_get_affinity(struct device *_d,
+ unsigned int irq_vec)
+{
+ struct virtio_device *dev = dev_to_virtio(_d);
+
+ if (!dev->config->get_vq_affinity)
+ return NULL;
+
+ return dev->config->get_vq_affinity(dev, irq_vec);
+}
+
static const struct bus_type virtio_bus = {
.name = "virtio",
.match = virtio_dev_match,
@@ -384,6 +402,7 @@ static const struct bus_type virtio_bus = {
.uevent = virtio_uevent,
.probe = virtio_dev_probe,
.remove = virtio_dev_remove,
+ .irq_get_affinity = virtio_irq_get_affinity,
};
int __register_virtio_driver(struct virtio_driver *driver, struct module *owner)
--
2.47.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v4 05/10] blk-mq: introduce blk_mq_hctx_map_queues
2024-11-13 14:26 [PATCH v4 00/10] blk: refactor queue affinity helpers Daniel Wagner
` (3 preceding siblings ...)
2024-11-13 14:26 ` [PATCH v4 04/10] virtio: " Daniel Wagner
@ 2024-11-13 14:26 ` Daniel Wagner
2024-11-14 1:58 ` Ming Lei
2024-11-13 14:26 ` [PATCH v4 06/10] scsi: replace blk_mq_pci_map_queues with blk_mq_hctx_map_queues Daniel Wagner
` (4 subsequent siblings)
9 siblings, 1 reply; 25+ messages in thread
From: Daniel Wagner @ 2024-11-13 14:26 UTC (permalink / raw)
To: Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin, Jason Wang,
Xuan Zhuo, Eugenio Pérez, Martin K. Petersen, Keith Busch,
Christoph Hellwig, Sagi Grimberg, John Garry, Greg Kroah-Hartman,
Hannes Reinecke
Cc: linux-block, linux-kernel, linux-pci, virtualization, linux-scsi,
megaraidlinux.pdl, mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl,
storagedev, linux-nvme, Daniel Wagner
blk_mq_pci_map_queues and blk_mq_virtio_map_queues will create a CPU to
hardware queue mapping based on affinity information. These two function
share common code and only differ on how the affinity information is
retrieved. Also, those functions are located in the block subsystem
where it doesn't really fit in. They are virtio and pci subsystem
specific.
Thus introduce provide a generic mapping function which uses the
irq_get_affinity callback from bus_type.
Originally idea from Ming Lei <ming.lei@redhat.com>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
---
block/blk-mq-cpumap.c | 43 +++++++++++++++++++++++++++++++++++++++++++
include/linux/blk-mq.h | 2 ++
2 files changed, 45 insertions(+)
diff --git a/block/blk-mq-cpumap.c b/block/blk-mq-cpumap.c
index 9638b25fd52124f0173e968ebdca5f1fe0b42ad9..3506f1c25a02d331d28212a2a97fb269cb21e738 100644
--- a/block/blk-mq-cpumap.c
+++ b/block/blk-mq-cpumap.c
@@ -11,6 +11,7 @@
#include <linux/smp.h>
#include <linux/cpu.h>
#include <linux/group_cpus.h>
+#include <linux/device/bus.h>
#include "blk.h"
#include "blk-mq.h"
@@ -54,3 +55,45 @@ int blk_mq_hw_queue_to_node(struct blk_mq_queue_map *qmap, unsigned int index)
return NUMA_NO_NODE;
}
+
+/**
+ * blk_mq_hctx_map_queues - Create CPU to hardware queue mapping
+ * @qmap: CPU to hardware queue map.
+ * @dev: The device to map queues.
+ * @offset: Queue offset to use for the device.
+ *
+ * Create a CPU to hardware queue mapping in @qmap. The struct bus_type
+ * irq_get_affinity callback will be used to retrieve the affinity.
+ */
+void blk_mq_hctx_map_queues(struct blk_mq_queue_map *qmap,
+ struct device *dev, unsigned int offset)
+
+{
+ const struct cpumask *(*irq_get_affinity)(struct device *dev,
+ unsigned int irq_vec);
+ const struct cpumask *mask;
+ unsigned int queue, cpu;
+
+ if (dev->driver->irq_get_affinity)
+ irq_get_affinity = dev->driver->irq_get_affinity;
+ else if (dev->bus->irq_get_affinity)
+ irq_get_affinity = dev->bus->irq_get_affinity;
+ else
+ goto fallback;
+
+ for (queue = 0; queue < qmap->nr_queues; queue++) {
+ mask = irq_get_affinity(dev, queue + offset);
+ if (!mask)
+ goto fallback;
+
+ for_each_cpu(cpu, mask)
+ qmap->mq_map[cpu] = qmap->queue_offset + queue;
+ }
+
+ return;
+
+fallback:
+ WARN_ON_ONCE(qmap->nr_queues > 1);
+ blk_mq_clear_mq_map(qmap);
+}
+EXPORT_SYMBOL_GPL(blk_mq_hctx_map_queues);
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index 2035fad3131fb60781957095ce8a3a941dd104be..1a85fdcb443c154390cd29f2b1f2a807bf10bfe3 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -923,6 +923,8 @@ void blk_mq_unfreeze_queue_non_owner(struct request_queue *q);
void blk_freeze_queue_start_non_owner(struct request_queue *q);
void blk_mq_map_queues(struct blk_mq_queue_map *qmap);
+void blk_mq_hctx_map_queues(struct blk_mq_queue_map *qmap,
+ struct device *dev, unsigned int offset);
void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues);
void blk_mq_quiesce_queue_nowait(struct request_queue *q);
--
2.47.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v4 06/10] scsi: replace blk_mq_pci_map_queues with blk_mq_hctx_map_queues
2024-11-13 14:26 [PATCH v4 00/10] blk: refactor queue affinity helpers Daniel Wagner
` (4 preceding siblings ...)
2024-11-13 14:26 ` [PATCH v4 05/10] blk-mq: introduce blk_mq_hctx_map_queues Daniel Wagner
@ 2024-11-13 14:26 ` Daniel Wagner
2024-11-13 14:26 ` [PATCH v4 07/10] scsi: hisi_sas: use blk_mq_hctx_map_queues to map queues Daniel Wagner
` (3 subsequent siblings)
9 siblings, 0 replies; 25+ messages in thread
From: Daniel Wagner @ 2024-11-13 14:26 UTC (permalink / raw)
To: Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin, Jason Wang,
Xuan Zhuo, Eugenio Pérez, Martin K. Petersen, Keith Busch,
Christoph Hellwig, Sagi Grimberg, John Garry, Greg Kroah-Hartman,
Hannes Reinecke
Cc: linux-block, linux-kernel, linux-pci, virtualization, linux-scsi,
megaraidlinux.pdl, mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl,
storagedev, linux-nvme, Daniel Wagner
Replace all users of blk_mq_pci_map_queues with the more generic
blk_mq_hctx_map_queues. This in preparation to retire
blk_mq_pci_map_queues.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
---
drivers/scsi/fnic/fnic_main.c | 3 +--
drivers/scsi/hisi_sas/hisi_sas.h | 1 -
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 4 ++--
drivers/scsi/megaraid/megaraid_sas_base.c | 3 +--
drivers/scsi/mpi3mr/mpi3mr.h | 1 -
drivers/scsi/mpi3mr/mpi3mr_os.c | 2 +-
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 3 +--
drivers/scsi/pm8001/pm8001_init.c | 2 +-
drivers/scsi/pm8001/pm8001_sas.h | 1 -
drivers/scsi/qla2xxx/qla_nvme.c | 3 +--
drivers/scsi/qla2xxx/qla_os.c | 4 ++--
drivers/scsi/smartpqi/smartpqi_init.c | 7 +++----
12 files changed, 13 insertions(+), 21 deletions(-)
diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c
index adec0df24bc475ea4d7d8089ea0f75fe96746956..74a782780cc4f8b298168bb14809973a8206095f 100644
--- a/drivers/scsi/fnic/fnic_main.c
+++ b/drivers/scsi/fnic/fnic_main.c
@@ -16,7 +16,6 @@
#include <linux/spinlock.h>
#include <linux/workqueue.h>
#include <linux/if_ether.h>
-#include <linux/blk-mq-pci.h>
#include <scsi/fc/fc_fip.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_transport.h>
@@ -601,7 +600,7 @@ void fnic_mq_map_queues_cpus(struct Scsi_Host *host)
return;
}
- blk_mq_pci_map_queues(qmap, l_pdev, FNIC_PCI_OFFSET);
+ blk_mq_hctx_map_queues(qmap, &l_pdev->dev, FNIC_PCI_OFFSET);
}
static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h
index d223f482488fc6cebc2838e92ae7ec70fb4e1437..010479a354eeeb47bbee24102e450aa3b7ea6197 100644
--- a/drivers/scsi/hisi_sas/hisi_sas.h
+++ b/drivers/scsi/hisi_sas/hisi_sas.h
@@ -9,7 +9,6 @@
#include <linux/acpi.h>
#include <linux/blk-mq.h>
-#include <linux/blk-mq-pci.h>
#include <linux/clk.h>
#include <linux/debugfs.h>
#include <linux/dmapool.h>
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
index 4cd3a3eab6f1c47c962565a74cd7284dad1db12e..a7810fb01403a812389fbd11f8b3bea2ea7c28eb 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
@@ -3322,8 +3322,8 @@ static void hisi_sas_map_queues(struct Scsi_Host *shost)
if (i == HCTX_TYPE_POLL)
blk_mq_map_queues(qmap);
else
- blk_mq_pci_map_queues(qmap, hisi_hba->pci_dev,
- BASE_VECTORS_V3_HW);
+ blk_mq_hctx_map_queues(qmap, hisi_hba->dev,
+ BASE_VECTORS_V3_HW);
qoff += qmap->nr_queues;
}
}
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 8e75e2e279a40ae5fdc6b7b07a7aed15241a8d54..0180bb56de52bb57f15fae22df0d413cdd576ba3 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -37,7 +37,6 @@
#include <linux/poll.h>
#include <linux/vmalloc.h>
#include <linux/irq_poll.h>
-#include <linux/blk-mq-pci.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
@@ -3193,7 +3192,7 @@ static void megasas_map_queues(struct Scsi_Host *shost)
map = &shost->tag_set.map[HCTX_TYPE_DEFAULT];
map->nr_queues = instance->msix_vectors - offset;
map->queue_offset = 0;
- blk_mq_pci_map_queues(map, instance->pdev, offset);
+ blk_mq_hctx_map_queues(map, &instance->pdev->dev, offset);
qoff += map->nr_queues;
offset += map->nr_queues;
diff --git a/drivers/scsi/mpi3mr/mpi3mr.h b/drivers/scsi/mpi3mr/mpi3mr.h
index 81bb408ce56d8f9599e6f62276666bedce6d0d32..57ccea42ece1ecf1c471ee744213453b13db0ea1 100644
--- a/drivers/scsi/mpi3mr/mpi3mr.h
+++ b/drivers/scsi/mpi3mr/mpi3mr.h
@@ -12,7 +12,6 @@
#include <linux/blkdev.h>
#include <linux/blk-mq.h>
-#include <linux/blk-mq-pci.h>
#include <linux/delay.h>
#include <linux/dmapool.h>
#include <linux/errno.h>
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 5f2f67acf8bf3194cb8ec78904096ffb4bdd7ff2..e898b476af6dc84eb150ec867e6be8dd1b2d4d8a 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -4042,7 +4042,7 @@ static void mpi3mr_map_queues(struct Scsi_Host *shost)
*/
map->queue_offset = qoff;
if (i != HCTX_TYPE_POLL)
- blk_mq_pci_map_queues(map, mrioc->pdev, offset);
+ blk_mq_hctx_map_queues(map, &mrioc->pdev->dev, offset);
else
blk_mq_map_queues(map);
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index f2a55aa5fe65036a3beabae5c0c6e9db835d2aab..efb95fcef7ed71fc5daea215508e04b602d31663 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -53,7 +53,6 @@
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/raid_class.h>
-#include <linux/blk-mq-pci.h>
#include <linux/unaligned.h>
#include "mpt3sas_base.h"
@@ -11890,7 +11889,7 @@ static void scsih_map_queues(struct Scsi_Host *shost)
*/
map->queue_offset = qoff;
if (i != HCTX_TYPE_POLL)
- blk_mq_pci_map_queues(map, ioc->pdev, offset);
+ blk_mq_hctx_map_queues(map, &ioc->pdev->dev, offset);
else
blk_mq_map_queues(map);
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index 33e1eba62ca12c2555419197ecdbebad817e4a6d..035e102979f0de34b637be81e0f64b588a3893c8 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -101,7 +101,7 @@ static void pm8001_map_queues(struct Scsi_Host *shost)
struct blk_mq_queue_map *qmap = &shost->tag_set.map[HCTX_TYPE_DEFAULT];
if (pm8001_ha->number_of_intr > 1) {
- blk_mq_pci_map_queues(qmap, pm8001_ha->pdev, 1);
+ blk_mq_hctx_map_queues(qmap, &pm8001_ha->pdev->dev, 1);
return;
}
diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h
index ced6721380a85345a74a87ebd2facdaa513f8768..c46470e0cf63b7b18b9572c8d6b4f4ddf489aa2b 100644
--- a/drivers/scsi/pm8001/pm8001_sas.h
+++ b/drivers/scsi/pm8001/pm8001_sas.h
@@ -56,7 +56,6 @@
#include <scsi/sas_ata.h>
#include <linux/atomic.h>
#include <linux/blk-mq.h>
-#include <linux/blk-mq-pci.h>
#include "pm8001_defs.h"
#define DRV_NAME "pm80xx"
diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index 8f4cc136a9c9c46f5f2d5408f9b7688ef520a8a3..2b2eeec159880d0178eb07455a7eac0e63d66af4 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -8,7 +8,6 @@
#include <linux/delay.h>
#include <linux/nvme.h>
#include <linux/nvme-fc.h>
-#include <linux/blk-mq-pci.h>
#include <linux/blk-mq.h>
static struct nvme_fc_port_template qla_nvme_fc_transport;
@@ -841,7 +840,7 @@ static void qla_nvme_map_queues(struct nvme_fc_local_port *lport,
{
struct scsi_qla_host *vha = lport->private;
- blk_mq_pci_map_queues(map, vha->hw->pdev, vha->irq_offset);
+ blk_mq_hctx_map_queues(map, &vha->hw->pdev->dev, vha->irq_offset);
}
static void qla_nvme_localport_delete(struct nvme_fc_local_port *lport)
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 7f980e6141c28282d4c4a0123dda96e36e1f180e..acf26d09fa4563409d50fbba118f3b37732a7c8b 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -13,7 +13,6 @@
#include <linux/mutex.h>
#include <linux/kobject.h>
#include <linux/slab.h>
-#include <linux/blk-mq-pci.h>
#include <linux/refcount.h>
#include <linux/crash_dump.h>
#include <linux/trace_events.h>
@@ -8070,7 +8069,8 @@ static void qla2xxx_map_queues(struct Scsi_Host *shost)
if (USER_CTRL_IRQ(vha->hw) || !vha->hw->mqiobase)
blk_mq_map_queues(qmap);
else
- blk_mq_pci_map_queues(qmap, vha->hw->pdev, vha->irq_offset);
+ blk_mq_hctx_map_queues(qmap, &vha->hw->pdev->dev,
+ vha->irq_offset);
}
struct scsi_host_template qla2xxx_driver_template = {
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 870f37b7054644426a2695e857c45a0a12aff051..501af16d872b1295071a99208248f1d83f072ab5 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -19,7 +19,6 @@
#include <linux/bcd.h>
#include <linux/reboot.h>
#include <linux/cciss_ioctl.h>
-#include <linux/blk-mq-pci.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
@@ -6547,10 +6546,10 @@ static void pqi_map_queues(struct Scsi_Host *shost)
struct pqi_ctrl_info *ctrl_info = shost_to_hba(shost);
if (!ctrl_info->disable_managed_interrupts)
- return blk_mq_pci_map_queues(&shost->tag_set.map[HCTX_TYPE_DEFAULT],
- ctrl_info->pci_dev, 0);
+ blk_mq_hctx_map_queues(&shost->tag_set.map[HCTX_TYPE_DEFAULT],
+ &ctrl_info->pci_dev->dev, 0);
else
- return blk_mq_map_queues(&shost->tag_set.map[HCTX_TYPE_DEFAULT]);
+ blk_mq_map_queues(&shost->tag_set.map[HCTX_TYPE_DEFAULT]);
}
static inline bool pqi_is_tape_changer_device(struct pqi_scsi_dev *device)
--
2.47.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v4 07/10] scsi: hisi_sas: use blk_mq_hctx_map_queues to map queues
2024-11-13 14:26 [PATCH v4 00/10] blk: refactor queue affinity helpers Daniel Wagner
` (5 preceding siblings ...)
2024-11-13 14:26 ` [PATCH v4 06/10] scsi: replace blk_mq_pci_map_queues with blk_mq_hctx_map_queues Daniel Wagner
@ 2024-11-13 14:26 ` Daniel Wagner
2024-11-14 0:36 ` kernel test robot
2024-11-14 3:28 ` kernel test robot
2024-11-13 14:26 ` [PATCH v4 08/10] nvme: replace blk_mq_pci_map_queues with blk_mq_hctx_map_queues Daniel Wagner
` (2 subsequent siblings)
9 siblings, 2 replies; 25+ messages in thread
From: Daniel Wagner @ 2024-11-13 14:26 UTC (permalink / raw)
To: Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin, Jason Wang,
Xuan Zhuo, Eugenio Pérez, Martin K. Petersen, Keith Busch,
Christoph Hellwig, Sagi Grimberg, John Garry, Greg Kroah-Hartman,
Hannes Reinecke
Cc: linux-block, linux-kernel, linux-pci, virtualization, linux-scsi,
megaraidlinux.pdl, mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl,
storagedev, linux-nvme, Daniel Wagner
The PCI struct bus_type irq_get_affinity callback can't be used here as
hisi_sas v2 implements its own irq affinity code. Thus install a driver
specific irq_get_affinity callback. With this in place it's possible to
replace the open coded queue mapping with blk_mq_hctx_map_queues
function.
Signed-off-by: Daniel Wagner <wagi@kernel.org>
---
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index 342d75f12051d28fb1a0692b45ff568dd5b6f814..faa85fbf3e267cf883568d1808207e9a56c70674 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
@@ -3372,7 +3372,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
for (queue_no = 0; queue_no < hisi_hba->cq_nvecs; queue_no++) {
struct hisi_sas_cq *cq = &hisi_hba->cq[queue_no];
- cq->irq_no = hisi_hba->irq_map[queue_no + 96];
+ cq->irq_no = hisi_hba->irq_map[queue_no + COQ_IRQ_INDEX];
rc = devm_request_threaded_irq(dev, cq->irq_no,
cq_interrupt_v2_hw,
cq_thread_v2_hw, IRQF_ONESHOT,
@@ -3389,6 +3389,14 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
return rc;
}
+static const struct cpumask *hisi_sas_v2_irq_get_affinity(struct device *dev,
+ unsigned int irq_vec)
+{
+ struct hisi_hba *hisi_hba = dev->driver_data;
+
+ return irq_get_affinity_mask(hisi_hba->irq_map[irq_vec]);
+}
+
static int hisi_sas_v2_init(struct hisi_hba *hisi_hba)
{
int rc;
@@ -3553,17 +3561,8 @@ static void map_queues_v2_hw(struct Scsi_Host *shost)
{
struct hisi_hba *hisi_hba = shost_priv(shost);
struct blk_mq_queue_map *qmap = &shost->tag_set.map[HCTX_TYPE_DEFAULT];
- const struct cpumask *mask;
- unsigned int queue, cpu;
- for (queue = 0; queue < qmap->nr_queues; queue++) {
- mask = irq_get_affinity_mask(hisi_hba->irq_map[96 + queue]);
- if (!mask)
- continue;
-
- for_each_cpu(cpu, mask)
- qmap->mq_map[cpu] = qmap->queue_offset + queue;
- }
+ blk_mq_hctx_map_queues(qmap, hisi_hba->dev, CQ0_IRQ_INDEX);
}
static const struct scsi_host_template sht_v2_hw = {
@@ -3636,6 +3635,7 @@ static struct platform_driver hisi_sas_v2_driver = {
.name = DRV_NAME,
.of_match_table = sas_v2_of_match,
.acpi_match_table = ACPI_PTR(sas_v2_acpi_match),
+ .irq_get_affinity = hisi_sas_v2_irq_get_affinity,
},
};
--
2.47.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v4 08/10] nvme: replace blk_mq_pci_map_queues with blk_mq_hctx_map_queues
2024-11-13 14:26 [PATCH v4 00/10] blk: refactor queue affinity helpers Daniel Wagner
` (6 preceding siblings ...)
2024-11-13 14:26 ` [PATCH v4 07/10] scsi: hisi_sas: use blk_mq_hctx_map_queues to map queues Daniel Wagner
@ 2024-11-13 14:26 ` Daniel Wagner
2024-11-13 14:26 ` [PATCH v4 09/10] virtio: blk/scsi: replace blk_mq_virtio_map_queues " Daniel Wagner
2024-11-13 14:26 ` [PATCH v4 10/10] blk-mq: remove unused queue mapping helpers Daniel Wagner
9 siblings, 0 replies; 25+ messages in thread
From: Daniel Wagner @ 2024-11-13 14:26 UTC (permalink / raw)
To: Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin, Jason Wang,
Xuan Zhuo, Eugenio Pérez, Martin K. Petersen, Keith Busch,
Christoph Hellwig, Sagi Grimberg, John Garry, Greg Kroah-Hartman,
Hannes Reinecke
Cc: linux-block, linux-kernel, linux-pci, virtualization, linux-scsi,
megaraidlinux.pdl, mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl,
storagedev, linux-nvme, Daniel Wagner
Replace all users of blk_mq_pci_map_queues with the more generic
blk_mq_hctx_map_queues. This in preparation to retire
blk_mq_pci_map_queues.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
---
drivers/nvme/host/fc.c | 1 -
drivers/nvme/host/pci.c | 3 +--
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index b81af7919e94c421387033bf8361a9cf8a867486..094be164ffdc0fb79050cfb92c32dfaee8d15622 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -16,7 +16,6 @@
#include <linux/nvme-fc.h>
#include "fc.h"
#include <scsi/scsi_transport_fc.h>
-#include <linux/blk-mq-pci.h>
/* *************************** Data Structures/Defines ****************** */
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 4b9fda0b1d9a33af4d7030b72532835b205e9cbb..cb8ca574594d7eb5f959cf9eb03be445223b2666 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -8,7 +8,6 @@
#include <linux/async.h>
#include <linux/blkdev.h>
#include <linux/blk-mq.h>
-#include <linux/blk-mq-pci.h>
#include <linux/blk-integrity.h>
#include <linux/dmi.h>
#include <linux/init.h>
@@ -457,7 +456,7 @@ static void nvme_pci_map_queues(struct blk_mq_tag_set *set)
*/
map->queue_offset = qoff;
if (i != HCTX_TYPE_POLL && offset)
- blk_mq_pci_map_queues(map, to_pci_dev(dev->dev), offset);
+ blk_mq_hctx_map_queues(map, dev->dev, offset);
else
blk_mq_map_queues(map);
qoff += map->nr_queues;
--
2.47.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v4 09/10] virtio: blk/scsi: replace blk_mq_virtio_map_queues with blk_mq_hctx_map_queues
2024-11-13 14:26 [PATCH v4 00/10] blk: refactor queue affinity helpers Daniel Wagner
` (7 preceding siblings ...)
2024-11-13 14:26 ` [PATCH v4 08/10] nvme: replace blk_mq_pci_map_queues with blk_mq_hctx_map_queues Daniel Wagner
@ 2024-11-13 14:26 ` Daniel Wagner
2024-11-13 14:26 ` [PATCH v4 10/10] blk-mq: remove unused queue mapping helpers Daniel Wagner
9 siblings, 0 replies; 25+ messages in thread
From: Daniel Wagner @ 2024-11-13 14:26 UTC (permalink / raw)
To: Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin, Jason Wang,
Xuan Zhuo, Eugenio Pérez, Martin K. Petersen, Keith Busch,
Christoph Hellwig, Sagi Grimberg, John Garry, Greg Kroah-Hartman,
Hannes Reinecke
Cc: linux-block, linux-kernel, linux-pci, virtualization, linux-scsi,
megaraidlinux.pdl, mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl,
storagedev, linux-nvme, Daniel Wagner
Replace all users of blk_mq_virtio_map_queues with the more generic
blk_mq_hctx_map_queues. This in preparation to retire
blk_mq_virtio_map_queues.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
---
drivers/block/virtio_blk.c | 4 ++--
drivers/scsi/virtio_scsi.c | 3 +--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 0e99a4714928478c1ba81777b8e98448eb5b992a..fd997e3381526eb3d7a21eda296b3a8a2998c696 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -13,7 +13,6 @@
#include <linux/string_helpers.h>
#include <linux/idr.h>
#include <linux/blk-mq.h>
-#include <linux/blk-mq-virtio.h>
#include <linux/numa.h>
#include <linux/vmalloc.h>
#include <uapi/linux/virtio_ring.h>
@@ -1186,7 +1185,8 @@ static void virtblk_map_queues(struct blk_mq_tag_set *set)
if (i == HCTX_TYPE_POLL)
blk_mq_map_queues(&set->map[i]);
else
- blk_mq_virtio_map_queues(&set->map[i], vblk->vdev, 0);
+ blk_mq_hctx_map_queues(&set->map[i],
+ &vblk->vdev->dev, 0);
}
}
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index 8471f38b730e205eb57052305c154260864bee95..dcb83c15f90825bd7bdb3a5f541108b934a308f3 100644
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@ -29,7 +29,6 @@
#include <scsi/scsi_tcq.h>
#include <scsi/scsi_devinfo.h>
#include <linux/seqlock.h>
-#include <linux/blk-mq-virtio.h>
#include "sd.h"
@@ -746,7 +745,7 @@ static void virtscsi_map_queues(struct Scsi_Host *shost)
if (i == HCTX_TYPE_POLL)
blk_mq_map_queues(map);
else
- blk_mq_virtio_map_queues(map, vscsi->vdev, 2);
+ blk_mq_hctx_map_queues(map, &vscsi->vdev->dev, 2);
}
}
--
2.47.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v4 10/10] blk-mq: remove unused queue mapping helpers
2024-11-13 14:26 [PATCH v4 00/10] blk: refactor queue affinity helpers Daniel Wagner
` (8 preceding siblings ...)
2024-11-13 14:26 ` [PATCH v4 09/10] virtio: blk/scsi: replace blk_mq_virtio_map_queues " Daniel Wagner
@ 2024-11-13 14:26 ` Daniel Wagner
9 siblings, 0 replies; 25+ messages in thread
From: Daniel Wagner @ 2024-11-13 14:26 UTC (permalink / raw)
To: Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin, Jason Wang,
Xuan Zhuo, Eugenio Pérez, Martin K. Petersen, Keith Busch,
Christoph Hellwig, Sagi Grimberg, John Garry, Greg Kroah-Hartman,
Hannes Reinecke
Cc: linux-block, linux-kernel, linux-pci, virtualization, linux-scsi,
megaraidlinux.pdl, mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl,
storagedev, linux-nvme, Daniel Wagner
There are no users left of the pci and virtio queue mapping helpers.
Thus remove them.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
---
block/Makefile | 2 --
block/blk-mq-pci.c | 46 -------------------------------------------
block/blk-mq-virtio.c | 46 -------------------------------------------
include/linux/blk-mq-pci.h | 11 -----------
include/linux/blk-mq-virtio.h | 11 -----------
5 files changed, 116 deletions(-)
diff --git a/block/Makefile b/block/Makefile
index ddfd21c1a9ffc9c4f49efca9875bd8a1cbf81e4d..33748123710b368a1a3a7b099bbd90d27b24c69b 100644
--- a/block/Makefile
+++ b/block/Makefile
@@ -27,8 +27,6 @@ bfq-y := bfq-iosched.o bfq-wf2q.o bfq-cgroup.o
obj-$(CONFIG_IOSCHED_BFQ) += bfq.o
obj-$(CONFIG_BLK_DEV_INTEGRITY) += bio-integrity.o blk-integrity.o t10-pi.o
-obj-$(CONFIG_BLK_MQ_PCI) += blk-mq-pci.o
-obj-$(CONFIG_BLK_MQ_VIRTIO) += blk-mq-virtio.o
obj-$(CONFIG_BLK_DEV_ZONED) += blk-zoned.o
obj-$(CONFIG_BLK_WBT) += blk-wbt.o
obj-$(CONFIG_BLK_DEBUG_FS) += blk-mq-debugfs.o
diff --git a/block/blk-mq-pci.c b/block/blk-mq-pci.c
deleted file mode 100644
index d47b5c73c9eb715be7627a2952ad0ef921dd5bc6..0000000000000000000000000000000000000000
--- a/block/blk-mq-pci.c
+++ /dev/null
@@ -1,46 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Copyright (c) 2016 Christoph Hellwig.
- */
-#include <linux/kobject.h>
-#include <linux/blkdev.h>
-#include <linux/blk-mq-pci.h>
-#include <linux/pci.h>
-#include <linux/module.h>
-
-#include "blk-mq.h"
-
-/**
- * blk_mq_pci_map_queues - provide a default queue mapping for PCI device
- * @qmap: CPU to hardware queue map.
- * @pdev: PCI device associated with @set.
- * @offset: Offset to use for the pci irq vector
- *
- * This function assumes the PCI device @pdev has at least as many available
- * interrupt vectors as @set has queues. It will then query the vector
- * corresponding to each queue for it's affinity mask and built queue mapping
- * that maps a queue to the CPUs that have irq affinity for the corresponding
- * vector.
- */
-void blk_mq_pci_map_queues(struct blk_mq_queue_map *qmap, struct pci_dev *pdev,
- int offset)
-{
- const struct cpumask *mask;
- unsigned int queue, cpu;
-
- for (queue = 0; queue < qmap->nr_queues; queue++) {
- mask = pci_irq_get_affinity(pdev, queue + offset);
- if (!mask)
- goto fallback;
-
- for_each_cpu(cpu, mask)
- qmap->mq_map[cpu] = qmap->queue_offset + queue;
- }
-
- return;
-
-fallback:
- WARN_ON_ONCE(qmap->nr_queues > 1);
- blk_mq_clear_mq_map(qmap);
-}
-EXPORT_SYMBOL_GPL(blk_mq_pci_map_queues);
diff --git a/block/blk-mq-virtio.c b/block/blk-mq-virtio.c
deleted file mode 100644
index 68d0945c0b08a2be116125f46c3a56fcdb02aea8..0000000000000000000000000000000000000000
--- a/block/blk-mq-virtio.c
+++ /dev/null
@@ -1,46 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Copyright (c) 2016 Christoph Hellwig.
- */
-#include <linux/device.h>
-#include <linux/blk-mq-virtio.h>
-#include <linux/virtio_config.h>
-#include <linux/module.h>
-#include "blk-mq.h"
-
-/**
- * blk_mq_virtio_map_queues - provide a default queue mapping for virtio device
- * @qmap: CPU to hardware queue map.
- * @vdev: virtio device to provide a mapping for.
- * @first_vec: first interrupt vectors to use for queues (usually 0)
- *
- * This function assumes the virtio device @vdev has at least as many available
- * interrupt vectors as @set has queues. It will then query the vector
- * corresponding to each queue for it's affinity mask and built queue mapping
- * that maps a queue to the CPUs that have irq affinity for the corresponding
- * vector.
- */
-void blk_mq_virtio_map_queues(struct blk_mq_queue_map *qmap,
- struct virtio_device *vdev, int first_vec)
-{
- const struct cpumask *mask;
- unsigned int queue, cpu;
-
- if (!vdev->config->get_vq_affinity)
- goto fallback;
-
- for (queue = 0; queue < qmap->nr_queues; queue++) {
- mask = vdev->config->get_vq_affinity(vdev, first_vec + queue);
- if (!mask)
- goto fallback;
-
- for_each_cpu(cpu, mask)
- qmap->mq_map[cpu] = qmap->queue_offset + queue;
- }
-
- return;
-
-fallback:
- blk_mq_map_queues(qmap);
-}
-EXPORT_SYMBOL_GPL(blk_mq_virtio_map_queues);
diff --git a/include/linux/blk-mq-pci.h b/include/linux/blk-mq-pci.h
deleted file mode 100644
index ca544e1d3508f34ab6e198b0bb17efe88de4d14d..0000000000000000000000000000000000000000
--- a/include/linux/blk-mq-pci.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _LINUX_BLK_MQ_PCI_H
-#define _LINUX_BLK_MQ_PCI_H
-
-struct blk_mq_queue_map;
-struct pci_dev;
-
-void blk_mq_pci_map_queues(struct blk_mq_queue_map *qmap, struct pci_dev *pdev,
- int offset);
-
-#endif /* _LINUX_BLK_MQ_PCI_H */
diff --git a/include/linux/blk-mq-virtio.h b/include/linux/blk-mq-virtio.h
deleted file mode 100644
index 13226e9b22dd53e4289d506d49c52671de036ee8..0000000000000000000000000000000000000000
--- a/include/linux/blk-mq-virtio.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _LINUX_BLK_MQ_VIRTIO_H
-#define _LINUX_BLK_MQ_VIRTIO_H
-
-struct blk_mq_queue_map;
-struct virtio_device;
-
-void blk_mq_virtio_map_queues(struct blk_mq_queue_map *qmap,
- struct virtio_device *vdev, int first_vec);
-
-#endif /* _LINUX_BLK_MQ_VIRTIO_H */
--
2.47.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH v4 07/10] scsi: hisi_sas: use blk_mq_hctx_map_queues to map queues
2024-11-13 14:26 ` [PATCH v4 07/10] scsi: hisi_sas: use blk_mq_hctx_map_queues to map queues Daniel Wagner
@ 2024-11-14 0:36 ` kernel test robot
2024-11-14 7:08 ` Daniel Wagner
2024-11-14 3:28 ` kernel test robot
1 sibling, 1 reply; 25+ messages in thread
From: kernel test robot @ 2024-11-14 0:36 UTC (permalink / raw)
To: Daniel Wagner, Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin,
Jason Wang, Xuan Zhuo, Eugenio Pérez, Martin K. Petersen,
Keith Busch, Christoph Hellwig, Sagi Grimberg, John Garry,
Greg Kroah-Hartman, Hannes Reinecke
Cc: llvm, oe-kbuild-all, linux-block, linux-kernel, linux-pci,
virtualization, linux-scsi, megaraidlinux.pdl,
mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl, storagedev, linux-nvme,
Daniel Wagner
Hi Daniel,
kernel test robot noticed the following build errors:
[auto build test ERROR on c9af98a7e8af266bae73e9d662b8341da1ec5824]
url: https://github.com/intel-lab-lkp/linux/commits/Daniel-Wagner/driver-core-bus-add-irq_get_affinity-callback-to-bus_type/20241113-223232
base: c9af98a7e8af266bae73e9d662b8341da1ec5824
patch link: https://lore.kernel.org/r/20241113-refactor-blk-affinity-helpers-v4-7-dd3baa1e267f%40kernel.org
patch subject: [PATCH v4 07/10] scsi: hisi_sas: use blk_mq_hctx_map_queues to map queues
config: i386-buildonly-randconfig-006-20241114 (https://download.01.org/0day-ci/archive/20241114/202411140822.ZRutrwWP-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241114/202411140822.ZRutrwWP-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411140822.ZRutrwWP-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/scsi/hisi_sas/hisi_sas_v2_hw.c:7:
In file included from drivers/scsi/hisi_sas/hisi_sas.h:11:
In file included from include/linux/blk-mq.h:5:
In file included from include/linux/blkdev.h:9:
In file included from include/linux/blk_types.h:10:
In file included from include/linux/bvec.h:10:
In file included from include/linux/highmem.h:8:
In file included from include/linux/cacheflush.h:5:
In file included from arch/x86/include/asm/cacheflush.h:5:
In file included from include/linux/mm.h:2213:
include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
518 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
>> drivers/scsi/hisi_sas/hisi_sas_v2_hw.c:3375:45: error: use of undeclared identifier 'COQ_IRQ_INDEX'
3375 | cq->irq_no = hisi_hba->irq_map[queue_no + COQ_IRQ_INDEX];
| ^
1 warning and 1 error generated.
vim +/COQ_IRQ_INDEX +3375 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
3322
3323 /*
3324 * There is a limitation in the hip06 chipset that we need
3325 * to map in all mbigen interrupts, even if they are not used.
3326 */
3327 static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
3328 {
3329 struct platform_device *pdev = hisi_hba->platform_dev;
3330 struct device *dev = &pdev->dev;
3331 int irq, rc = 0;
3332 int i, phy_no, fatal_no, queue_no;
3333
3334 for (i = 0; i < HISI_SAS_PHY_INT_NR; i++) {
3335 irq = hisi_hba->irq_map[i + 1]; /* Phy up/down is irq1 */
3336 rc = devm_request_irq(dev, irq, phy_interrupts[i], 0,
3337 DRV_NAME " phy", hisi_hba);
3338 if (rc) {
3339 dev_err(dev, "irq init: could not request phy interrupt %d, rc=%d\n",
3340 irq, rc);
3341 rc = -ENOENT;
3342 goto err_out;
3343 }
3344 }
3345
3346 for (phy_no = 0; phy_no < hisi_hba->n_phy; phy_no++) {
3347 struct hisi_sas_phy *phy = &hisi_hba->phy[phy_no];
3348
3349 irq = hisi_hba->irq_map[phy_no + 72];
3350 rc = devm_request_irq(dev, irq, sata_int_v2_hw, 0,
3351 DRV_NAME " sata", phy);
3352 if (rc) {
3353 dev_err(dev, "irq init: could not request sata interrupt %d, rc=%d\n",
3354 irq, rc);
3355 rc = -ENOENT;
3356 goto err_out;
3357 }
3358 }
3359
3360 for (fatal_no = 0; fatal_no < HISI_SAS_FATAL_INT_NR; fatal_no++) {
3361 irq = hisi_hba->irq_map[fatal_no + 81];
3362 rc = devm_request_irq(dev, irq, fatal_interrupts[fatal_no], 0,
3363 DRV_NAME " fatal", hisi_hba);
3364 if (rc) {
3365 dev_err(dev, "irq init: could not request fatal interrupt %d, rc=%d\n",
3366 irq, rc);
3367 rc = -ENOENT;
3368 goto err_out;
3369 }
3370 }
3371
3372 for (queue_no = 0; queue_no < hisi_hba->cq_nvecs; queue_no++) {
3373 struct hisi_sas_cq *cq = &hisi_hba->cq[queue_no];
3374
> 3375 cq->irq_no = hisi_hba->irq_map[queue_no + COQ_IRQ_INDEX];
3376 rc = devm_request_threaded_irq(dev, cq->irq_no,
3377 cq_interrupt_v2_hw,
3378 cq_thread_v2_hw, IRQF_ONESHOT,
3379 DRV_NAME " cq", cq);
3380 if (rc) {
3381 dev_err(dev, "irq init: could not request cq interrupt %d, rc=%d\n",
3382 cq->irq_no, rc);
3383 rc = -ENOENT;
3384 goto err_out;
3385 }
3386 cq->irq_mask = irq_get_affinity_mask(cq->irq_no);
3387 }
3388 err_out:
3389 return rc;
3390 }
3391
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v4 01/10] driver core: bus: add irq_get_affinity callback to bus_type
2024-11-13 14:26 ` [PATCH v4 01/10] driver core: bus: add irq_get_affinity callback to bus_type Daniel Wagner
@ 2024-11-14 1:45 ` Ming Lei
0 siblings, 0 replies; 25+ messages in thread
From: Ming Lei @ 2024-11-14 1:45 UTC (permalink / raw)
To: Daniel Wagner
Cc: Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin, Jason Wang,
Xuan Zhuo, Eugenio Pérez, Martin K. Petersen, Keith Busch,
Christoph Hellwig, Sagi Grimberg, John Garry, Greg Kroah-Hartman,
Hannes Reinecke, linux-block, linux-kernel, linux-pci,
virtualization, linux-scsi, megaraidlinux.pdl,
mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl, storagedev, linux-nvme
On Wed, Nov 13, 2024 at 03:26:15PM +0100, Daniel Wagner wrote:
> Introducing a callback in struct bus_type so that a subsystem
> can hook up the getters directly. This approach avoids exposing
> random getters in any subsystems APIs.
>
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Hannes Reinecke <hare@suse.de>
> Signed-off-by: Daniel Wagner <wagi@kernel.org>
> ---
> include/linux/device/bus.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/include/linux/device/bus.h b/include/linux/device/bus.h
> index cdc4757217f9bb4b36b5c3b8a48bab45737e44c5..b18658bce2c3819fc1cbeb38fb98391d56ec3317 100644
> --- a/include/linux/device/bus.h
> +++ b/include/linux/device/bus.h
> @@ -48,6 +48,7 @@ struct fwnode_handle;
> * will never get called until they do.
> * @remove: Called when a device removed from this bus.
> * @shutdown: Called at shut-down time to quiesce the device.
> + * @irq_get_affinity: Get IRQ affinity mask for the device on this bus.
> *
> * @online: Called to put the device back online (after offlining it).
> * @offline: Called to put the device offline for hot-removal. May fail.
> @@ -87,6 +88,8 @@ struct bus_type {
> void (*sync_state)(struct device *dev);
> void (*remove)(struct device *dev);
> void (*shutdown)(struct device *dev);
> + const struct cpumask *(*irq_get_affinity)(struct device *dev,
> + unsigned int irq_vec);
>
> int (*online)(struct device *dev);
> int (*offline)(struct device *dev);
>
Looks one nice abstraction,
Reviewed-by: Ming Lei <ming.lei@redhat.com>
--
Ming
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v4 02/10] driver core: add irq_get_affinity callback device_driver
2024-11-13 14:26 ` [PATCH v4 02/10] driver core: add irq_get_affinity callback device_driver Daniel Wagner
@ 2024-11-14 1:52 ` Ming Lei
2024-11-14 7:06 ` Daniel Wagner
0 siblings, 1 reply; 25+ messages in thread
From: Ming Lei @ 2024-11-14 1:52 UTC (permalink / raw)
To: Daniel Wagner
Cc: Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin, Jason Wang,
Xuan Zhuo, Eugenio Pérez, Martin K. Petersen, Keith Busch,
Christoph Hellwig, Sagi Grimberg, John Garry, Greg Kroah-Hartman,
Hannes Reinecke, linux-block, linux-kernel, linux-pci,
virtualization, linux-scsi, megaraidlinux.pdl,
mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl, storagedev, linux-nvme
On Wed, Nov 13, 2024 at 03:26:16PM +0100, Daniel Wagner wrote:
> Introducing a callback in struct device_driver so that a device driver
> can hook up the getters directly. This approach avoids exposing random
> getters in drivers.
>
> Signed-off-by: Daniel Wagner <wagi@kernel.org>
> ---
> include/linux/device/driver.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/include/linux/device/driver.h b/include/linux/device/driver.h
> index 5c04b8e3833b995f9fd4d65b8732b3dfce2eba7e..0d1aee423f6c076ae102bdd0536233c259947fac 100644
> --- a/include/linux/device/driver.h
> +++ b/include/linux/device/driver.h
> @@ -74,6 +74,7 @@ enum probe_type {
> * @suspend: Called to put the device to sleep mode. Usually to a
> * low power state.
> * @resume: Called to bring a device from sleep mode.
> + * @irq_get_affinity: Get IRQ affinity mask for the device.
> * @groups: Default attributes that get created by the driver core
> * automatically.
> * @dev_groups: Additional attributes attached to device instance once
> @@ -112,6 +113,8 @@ struct device_driver {
> void (*shutdown) (struct device *dev);
> int (*suspend) (struct device *dev, pm_message_t state);
> int (*resume) (struct device *dev);
> + const struct cpumask *(*irq_get_affinity)(struct device *dev,
> + unsigned int irq_vec);
> const struct attribute_group **groups;
> const struct attribute_group **dev_groups;
The patch looks fine, but if you put 1, 2 and 5 into single patch,
it will become much easier to review, anyway:
Reviewed-by: Ming Lei <ming.lei@redhat.com>
--
Ming
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v4 03/10] PCI: hookup irq_get_affinity callback
2024-11-13 14:26 ` [PATCH v4 03/10] PCI: hookup irq_get_affinity callback Daniel Wagner
@ 2024-11-14 1:53 ` Ming Lei
0 siblings, 0 replies; 25+ messages in thread
From: Ming Lei @ 2024-11-14 1:53 UTC (permalink / raw)
To: Daniel Wagner
Cc: Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin, Jason Wang,
Xuan Zhuo, Eugenio Pérez, Martin K. Petersen, Keith Busch,
Christoph Hellwig, Sagi Grimberg, John Garry, Greg Kroah-Hartman,
Hannes Reinecke, linux-block, linux-kernel, linux-pci,
virtualization, linux-scsi, megaraidlinux.pdl,
mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl, storagedev, linux-nvme
On Wed, Nov 13, 2024 at 03:26:17PM +0100, Daniel Wagner wrote:
> struct bus_type has a new callback for retrieving the IRQ affinity for a
> device. Hook this callback up for PCI based devices.
>
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Hannes Reinecke <hare@suse.de>
> Signed-off-by: Daniel Wagner <wagi@kernel.org>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
--
Ming
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v4 04/10] virtio: hookup irq_get_affinity callback
2024-11-13 14:26 ` [PATCH v4 04/10] virtio: " Daniel Wagner
@ 2024-11-14 1:54 ` Ming Lei
0 siblings, 0 replies; 25+ messages in thread
From: Ming Lei @ 2024-11-14 1:54 UTC (permalink / raw)
To: Daniel Wagner
Cc: Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin, Jason Wang,
Xuan Zhuo, Eugenio Pérez, Martin K. Petersen, Keith Busch,
Christoph Hellwig, Sagi Grimberg, John Garry, Greg Kroah-Hartman,
Hannes Reinecke, linux-block, linux-kernel, linux-pci,
virtualization, linux-scsi, megaraidlinux.pdl,
mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl, storagedev, linux-nvme
On Wed, Nov 13, 2024 at 03:26:18PM +0100, Daniel Wagner wrote:
> struct bus_type has a new callback for retrieving the IRQ affinity for a
> device. Hook this callback up for virtio based devices.
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Hannes Reinecke <hare@suse.de>
> Signed-off-by: Daniel Wagner <wagi@kernel.org>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
--
Ming
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v4 05/10] blk-mq: introduce blk_mq_hctx_map_queues
2024-11-13 14:26 ` [PATCH v4 05/10] blk-mq: introduce blk_mq_hctx_map_queues Daniel Wagner
@ 2024-11-14 1:58 ` Ming Lei
2024-11-14 7:54 ` Daniel Wagner
0 siblings, 1 reply; 25+ messages in thread
From: Ming Lei @ 2024-11-14 1:58 UTC (permalink / raw)
To: Daniel Wagner
Cc: Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin, Jason Wang,
Xuan Zhuo, Eugenio Pérez, Martin K. Petersen, Keith Busch,
Christoph Hellwig, Sagi Grimberg, John Garry, Greg Kroah-Hartman,
Hannes Reinecke, linux-block, linux-kernel, linux-pci,
virtualization, linux-scsi, megaraidlinux.pdl,
mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl, storagedev, linux-nvme
On Wed, Nov 13, 2024 at 03:26:19PM +0100, Daniel Wagner wrote:
> blk_mq_pci_map_queues and blk_mq_virtio_map_queues will create a CPU to
> hardware queue mapping based on affinity information. These two function
> share common code and only differ on how the affinity information is
> retrieved. Also, those functions are located in the block subsystem
> where it doesn't really fit in. They are virtio and pci subsystem
> specific.
>
> Thus introduce provide a generic mapping function which uses the
> irq_get_affinity callback from bus_type.
>
> Originally idea from Ming Lei <ming.lei@redhat.com>
>
> Signed-off-by: Daniel Wagner <wagi@kernel.org>
> ---
> block/blk-mq-cpumap.c | 43 +++++++++++++++++++++++++++++++++++++++++++
> include/linux/blk-mq.h | 2 ++
> 2 files changed, 45 insertions(+)
>
> diff --git a/block/blk-mq-cpumap.c b/block/blk-mq-cpumap.c
> index 9638b25fd52124f0173e968ebdca5f1fe0b42ad9..3506f1c25a02d331d28212a2a97fb269cb21e738 100644
> --- a/block/blk-mq-cpumap.c
> +++ b/block/blk-mq-cpumap.c
> @@ -11,6 +11,7 @@
> #include <linux/smp.h>
> #include <linux/cpu.h>
> #include <linux/group_cpus.h>
> +#include <linux/device/bus.h>
>
> #include "blk.h"
> #include "blk-mq.h"
> @@ -54,3 +55,45 @@ int blk_mq_hw_queue_to_node(struct blk_mq_queue_map *qmap, unsigned int index)
>
> return NUMA_NO_NODE;
> }
> +
> +/**
> + * blk_mq_hctx_map_queues - Create CPU to hardware queue mapping
> + * @qmap: CPU to hardware queue map.
> + * @dev: The device to map queues.
> + * @offset: Queue offset to use for the device.
> + *
> + * Create a CPU to hardware queue mapping in @qmap. The struct bus_type
> + * irq_get_affinity callback will be used to retrieve the affinity.
> + */
> +void blk_mq_hctx_map_queues(struct blk_mq_queue_map *qmap,
Some drivers may not know hctx at all, maybe blk_mq_map_hw_queues()?
> + struct device *dev, unsigned int offset)
> +
> +{
> + const struct cpumask *(*irq_get_affinity)(struct device *dev,
> + unsigned int irq_vec);
> + const struct cpumask *mask;
> + unsigned int queue, cpu;
> +
> + if (dev->driver->irq_get_affinity)
> + irq_get_affinity = dev->driver->irq_get_affinity;
> + else if (dev->bus->irq_get_affinity)
> + irq_get_affinity = dev->bus->irq_get_affinity;
It is one generic API, I think both 'dev->driver' and
'dev->bus' should be validated here.
Thanks,
Ming
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v4 07/10] scsi: hisi_sas: use blk_mq_hctx_map_queues to map queues
2024-11-13 14:26 ` [PATCH v4 07/10] scsi: hisi_sas: use blk_mq_hctx_map_queues to map queues Daniel Wagner
2024-11-14 0:36 ` kernel test robot
@ 2024-11-14 3:28 ` kernel test robot
1 sibling, 0 replies; 25+ messages in thread
From: kernel test robot @ 2024-11-14 3:28 UTC (permalink / raw)
To: Daniel Wagner, Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin,
Jason Wang, Xuan Zhuo, Eugenio Pérez, Martin K. Petersen,
Keith Busch, Christoph Hellwig, Sagi Grimberg, John Garry,
Greg Kroah-Hartman, Hannes Reinecke
Cc: oe-kbuild-all, linux-block, linux-kernel, linux-pci,
virtualization, linux-scsi, megaraidlinux.pdl,
mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl, storagedev, linux-nvme,
Daniel Wagner
Hi Daniel,
kernel test robot noticed the following build errors:
[auto build test ERROR on c9af98a7e8af266bae73e9d662b8341da1ec5824]
url: https://github.com/intel-lab-lkp/linux/commits/Daniel-Wagner/driver-core-bus-add-irq_get_affinity-callback-to-bus_type/20241113-223232
base: c9af98a7e8af266bae73e9d662b8341da1ec5824
patch link: https://lore.kernel.org/r/20241113-refactor-blk-affinity-helpers-v4-7-dd3baa1e267f%40kernel.org
patch subject: [PATCH v4 07/10] scsi: hisi_sas: use blk_mq_hctx_map_queues to map queues
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20241114/202411141102.q2IPCJ7K-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241114/202411141102.q2IPCJ7K-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411141102.q2IPCJ7K-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c: In function 'interrupt_init_v2_hw':
>> drivers/scsi/hisi_sas/hisi_sas_v2_hw.c:3375:59: error: 'COQ_IRQ_INDEX' undeclared (first use in this function); did you mean 'CQ0_IRQ_INDEX'?
3375 | cq->irq_no = hisi_hba->irq_map[queue_no + COQ_IRQ_INDEX];
| ^~~~~~~~~~~~~
| CQ0_IRQ_INDEX
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c:3375:59: note: each undeclared identifier is reported only once for each function it appears in
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c: At top level:
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c:3624:36: warning: 'sas_v2_acpi_match' defined but not used [-Wunused-const-variable=]
3624 | static const struct acpi_device_id sas_v2_acpi_match[] = {
| ^~~~~~~~~~~~~~~~~
vim +3375 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
3322
3323 /*
3324 * There is a limitation in the hip06 chipset that we need
3325 * to map in all mbigen interrupts, even if they are not used.
3326 */
3327 static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
3328 {
3329 struct platform_device *pdev = hisi_hba->platform_dev;
3330 struct device *dev = &pdev->dev;
3331 int irq, rc = 0;
3332 int i, phy_no, fatal_no, queue_no;
3333
3334 for (i = 0; i < HISI_SAS_PHY_INT_NR; i++) {
3335 irq = hisi_hba->irq_map[i + 1]; /* Phy up/down is irq1 */
3336 rc = devm_request_irq(dev, irq, phy_interrupts[i], 0,
3337 DRV_NAME " phy", hisi_hba);
3338 if (rc) {
3339 dev_err(dev, "irq init: could not request phy interrupt %d, rc=%d\n",
3340 irq, rc);
3341 rc = -ENOENT;
3342 goto err_out;
3343 }
3344 }
3345
3346 for (phy_no = 0; phy_no < hisi_hba->n_phy; phy_no++) {
3347 struct hisi_sas_phy *phy = &hisi_hba->phy[phy_no];
3348
3349 irq = hisi_hba->irq_map[phy_no + 72];
3350 rc = devm_request_irq(dev, irq, sata_int_v2_hw, 0,
3351 DRV_NAME " sata", phy);
3352 if (rc) {
3353 dev_err(dev, "irq init: could not request sata interrupt %d, rc=%d\n",
3354 irq, rc);
3355 rc = -ENOENT;
3356 goto err_out;
3357 }
3358 }
3359
3360 for (fatal_no = 0; fatal_no < HISI_SAS_FATAL_INT_NR; fatal_no++) {
3361 irq = hisi_hba->irq_map[fatal_no + 81];
3362 rc = devm_request_irq(dev, irq, fatal_interrupts[fatal_no], 0,
3363 DRV_NAME " fatal", hisi_hba);
3364 if (rc) {
3365 dev_err(dev, "irq init: could not request fatal interrupt %d, rc=%d\n",
3366 irq, rc);
3367 rc = -ENOENT;
3368 goto err_out;
3369 }
3370 }
3371
3372 for (queue_no = 0; queue_no < hisi_hba->cq_nvecs; queue_no++) {
3373 struct hisi_sas_cq *cq = &hisi_hba->cq[queue_no];
3374
> 3375 cq->irq_no = hisi_hba->irq_map[queue_no + COQ_IRQ_INDEX];
3376 rc = devm_request_threaded_irq(dev, cq->irq_no,
3377 cq_interrupt_v2_hw,
3378 cq_thread_v2_hw, IRQF_ONESHOT,
3379 DRV_NAME " cq", cq);
3380 if (rc) {
3381 dev_err(dev, "irq init: could not request cq interrupt %d, rc=%d\n",
3382 cq->irq_no, rc);
3383 rc = -ENOENT;
3384 goto err_out;
3385 }
3386 cq->irq_mask = irq_get_affinity_mask(cq->irq_no);
3387 }
3388 err_out:
3389 return rc;
3390 }
3391
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v4 02/10] driver core: add irq_get_affinity callback device_driver
2024-11-14 1:52 ` Ming Lei
@ 2024-11-14 7:06 ` Daniel Wagner
0 siblings, 0 replies; 25+ messages in thread
From: Daniel Wagner @ 2024-11-14 7:06 UTC (permalink / raw)
To: Ming Lei
Cc: Daniel Wagner, Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin,
Jason Wang, Xuan Zhuo, Eugenio Pérez, Martin K. Petersen,
Keith Busch, Christoph Hellwig, Sagi Grimberg, John Garry,
Greg Kroah-Hartman, Hannes Reinecke, linux-block, linux-kernel,
linux-pci, virtualization, linux-scsi, megaraidlinux.pdl,
mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl, storagedev, linux-nvme
On Thu, Nov 14, 2024 at 09:52:55AM +0800, Ming Lei wrote:
> On Wed, Nov 13, 2024 at 03:26:16PM +0100, Daniel Wagner wrote:
> > Introducing a callback in struct device_driver so that a device driver
> > can hook up the getters directly. This approach avoids exposing random
> > getters in drivers.
> >
> > Signed-off-by: Daniel Wagner <wagi@kernel.org>
> > ---
> > include/linux/device/driver.h | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/include/linux/device/driver.h b/include/linux/device/driver.h
> > index 5c04b8e3833b995f9fd4d65b8732b3dfce2eba7e..0d1aee423f6c076ae102bdd0536233c259947fac 100644
> > --- a/include/linux/device/driver.h
> > +++ b/include/linux/device/driver.h
> > @@ -74,6 +74,7 @@ enum probe_type {
> > * @suspend: Called to put the device to sleep mode. Usually to a
> > * low power state.
> > * @resume: Called to bring a device from sleep mode.
> > + * @irq_get_affinity: Get IRQ affinity mask for the device.
> > * @groups: Default attributes that get created by the driver core
> > * automatically.
> > * @dev_groups: Additional attributes attached to device instance once
> > @@ -112,6 +113,8 @@ struct device_driver {
> > void (*shutdown) (struct device *dev);
> > int (*suspend) (struct device *dev, pm_message_t state);
> > int (*resume) (struct device *dev);
> > + const struct cpumask *(*irq_get_affinity)(struct device *dev,
> > + unsigned int irq_vec);
> > const struct attribute_group **groups;
> > const struct attribute_group **dev_groups;
>
> The patch looks fine, but if you put 1, 2 and 5 into single patch,
> it will become much easier to review, anyway:
1 and 2 makes sense to merge. Christoph asked me to split 5 out 1 as it
mixed different things together
https://lore.kernel.org/linux-nvme/20241112044736.GA8883@lst.de/
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v4 07/10] scsi: hisi_sas: use blk_mq_hctx_map_queues to map queues
2024-11-14 0:36 ` kernel test robot
@ 2024-11-14 7:08 ` Daniel Wagner
0 siblings, 0 replies; 25+ messages in thread
From: Daniel Wagner @ 2024-11-14 7:08 UTC (permalink / raw)
To: kernel test robot
Cc: Daniel Wagner, Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin,
Jason Wang, Xuan Zhuo, Eugenio Pérez, Martin K. Petersen,
Keith Busch, Christoph Hellwig, Sagi Grimberg, John Garry,
Greg Kroah-Hartman, Hannes Reinecke, llvm, oe-kbuild-all,
linux-block, linux-kernel, linux-pci, virtualization, linux-scsi,
megaraidlinux.pdl, mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl,
storagedev, linux-nvme
On Thu, Nov 14, 2024 at 08:36:35AM +0800, kernel test robot wrote:
> >> drivers/scsi/hisi_sas/hisi_sas_v2_hw.c:3375:45: error: use of undeclared identifier 'COQ_IRQ_INDEX'
> 3375 | cq->irq_no = hisi_hba->irq_map[queue_no + COQ_IRQ_INDEX];
> | ^
Argh, I forgot to fold my fix in...
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v4 05/10] blk-mq: introduce blk_mq_hctx_map_queues
2024-11-14 1:58 ` Ming Lei
@ 2024-11-14 7:54 ` Daniel Wagner
2024-11-14 9:12 ` Ming Lei
0 siblings, 1 reply; 25+ messages in thread
From: Daniel Wagner @ 2024-11-14 7:54 UTC (permalink / raw)
To: Ming Lei
Cc: Daniel Wagner, Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin,
Jason Wang, Xuan Zhuo, Eugenio Pérez, Martin K. Petersen,
Keith Busch, Christoph Hellwig, Sagi Grimberg, John Garry,
Greg Kroah-Hartman, Hannes Reinecke, linux-block, linux-kernel,
linux-pci, virtualization, linux-scsi, megaraidlinux.pdl,
mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl, storagedev, linux-nvme
On Thu, Nov 14, 2024 at 09:58:25AM +0800, Ming Lei wrote:
> > +void blk_mq_hctx_map_queues(struct blk_mq_queue_map *qmap,
>
> Some drivers may not know hctx at all, maybe blk_mq_map_hw_queues()?
I am not really attach to the name, I am fine with renaming it to
blk_mq_map_hw_queues.
> > + if (dev->driver->irq_get_affinity)
> > + irq_get_affinity = dev->driver->irq_get_affinity;
> > + else if (dev->bus->irq_get_affinity)
> > + irq_get_affinity = dev->bus->irq_get_affinity;
>
> It is one generic API, I think both 'dev->driver' and
> 'dev->bus' should be validated here.
What do you have in mind here if we get two masks? What should the
operation be: AND, OR?
This brings up another topic I left out in this series.
blk_mq_map_queues does almost the same thing except it starts with the
mask returned by group_cpus_evenely. If we figure out how this could be
combined in a sane way it's possible to cleanup even a bit more. A bunch
of drivers do
if (i != HCTX_TYPE_POLL && offset)
blk_mq_hctx_map_queues(map, dev->dev, offset);
else
blk_mq_map_queues(map);
IMO it would be nice just to have one blk_mq_map_queues() which handles
this correctly for both cases.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v4 05/10] blk-mq: introduce blk_mq_hctx_map_queues
2024-11-14 7:54 ` Daniel Wagner
@ 2024-11-14 9:12 ` Ming Lei
2024-11-14 12:06 ` Daniel Wagner
0 siblings, 1 reply; 25+ messages in thread
From: Ming Lei @ 2024-11-14 9:12 UTC (permalink / raw)
To: Daniel Wagner
Cc: Daniel Wagner, Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin,
Jason Wang, Xuan Zhuo, Eugenio Pérez, Martin K. Petersen,
Keith Busch, Christoph Hellwig, Sagi Grimberg, John Garry,
Greg Kroah-Hartman, Hannes Reinecke, linux-block, linux-kernel,
linux-pci, virtualization, linux-scsi, megaraidlinux.pdl,
mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl, storagedev, linux-nvme
On Thu, Nov 14, 2024 at 08:54:46AM +0100, Daniel Wagner wrote:
> On Thu, Nov 14, 2024 at 09:58:25AM +0800, Ming Lei wrote:
> > > +void blk_mq_hctx_map_queues(struct blk_mq_queue_map *qmap,
> >
> > Some drivers may not know hctx at all, maybe blk_mq_map_hw_queues()?
>
> I am not really attach to the name, I am fine with renaming it to
> blk_mq_map_hw_queues.
>
> > > + if (dev->driver->irq_get_affinity)
> > > + irq_get_affinity = dev->driver->irq_get_affinity;
> > > + else if (dev->bus->irq_get_affinity)
> > > + irq_get_affinity = dev->bus->irq_get_affinity;
> >
> > It is one generic API, I think both 'dev->driver' and
> > 'dev->bus' should be validated here.
>
> What do you have in mind here if we get two masks? What should the
> operation be: AND, OR?
IMO you just need one callback to return the mask.
I feel driver should get higher priority, but in the probe() example,
call_driver_probe() actually tries bus->probe() first.
But looks not an issue for this patchset since only hisi_sas_v2_driver(platform_driver)
defines ->irq_get_affinity(), but the platform_bus_type doesn't have the callback.
>
> This brings up another topic I left out in this series.
> blk_mq_map_queues does almost the same thing except it starts with the
> mask returned by group_cpus_evenely. If we figure out how this could be
> combined in a sane way it's possible to cleanup even a bit more. A bunch
> of drivers do
>
> if (i != HCTX_TYPE_POLL && offset)
> blk_mq_hctx_map_queues(map, dev->dev, offset);
> else
> blk_mq_map_queues(map);
>
> IMO it would be nice just to have one blk_mq_map_queues() which handles
> this correctly for both cases.
I guess it is doable, and the driver just setup the tag_set->map[], then call
one generic map_queues API to do everything?
Thanks,
Ming
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v4 05/10] blk-mq: introduce blk_mq_hctx_map_queues
2024-11-14 9:12 ` Ming Lei
@ 2024-11-14 12:06 ` Daniel Wagner
2024-11-14 12:11 ` Christoph Hellwig
2024-11-14 12:20 ` John Garry
0 siblings, 2 replies; 25+ messages in thread
From: Daniel Wagner @ 2024-11-14 12:06 UTC (permalink / raw)
To: Ming Lei
Cc: Daniel Wagner, Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin,
Jason Wang, Xuan Zhuo, Eugenio Pérez, Martin K. Petersen,
Keith Busch, Christoph Hellwig, Sagi Grimberg, John Garry,
Greg Kroah-Hartman, Hannes Reinecke, linux-block, linux-kernel,
linux-pci, virtualization, linux-scsi, megaraidlinux.pdl,
mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl, storagedev, linux-nvme
On Thu, Nov 14, 2024 at 05:12:22PM +0800, Ming Lei wrote:
> I feel driver should get higher priority, but in the probe() example,
> call_driver_probe() actually tries bus->probe() first.
>
> But looks not an issue for this patchset since only hisi_sas_v2_driver(platform_driver)
> defines ->irq_get_affinity(), but the platform_bus_type doesn't have
> the callback.
Oh, I was not aware of this ordering. And after digging this up here:
https://lore.kernel.org/all/20060105142951.13.01@flint.arm.linux.org.uk/
I don't think we it's worthwhile to add the callback to device_driver
just for hisi_sas_v2. So I am going to drop this part again.
> > This brings up another topic I left out in this series.
> > blk_mq_map_queues does almost the same thing except it starts with the
> > mask returned by group_cpus_evenely. If we figure out how this could be
> > combined in a sane way it's possible to cleanup even a bit more. A bunch
> > of drivers do
> >
> > if (i != HCTX_TYPE_POLL && offset)
> > blk_mq_hctx_map_queues(map, dev->dev, offset);
> > else
> > blk_mq_map_queues(map);
> >
> > IMO it would be nice just to have one blk_mq_map_queues() which handles
> > this correctly for both cases.
>
> I guess it is doable, and the driver just setup the tag_set->map[], then call
> one generic map_queues API to do everything?
Yes, that is my idea. Just having one function which handles what
blk_mq_map_queues and blk_mq_hctx_map_queues/blk_mq_map_hw_queues
currently do.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v4 05/10] blk-mq: introduce blk_mq_hctx_map_queues
2024-11-14 12:06 ` Daniel Wagner
@ 2024-11-14 12:11 ` Christoph Hellwig
2024-11-14 12:20 ` John Garry
1 sibling, 0 replies; 25+ messages in thread
From: Christoph Hellwig @ 2024-11-14 12:11 UTC (permalink / raw)
To: Daniel Wagner
Cc: Ming Lei, Daniel Wagner, Jens Axboe, Bjorn Helgaas,
Michael S. Tsirkin, Jason Wang, Xuan Zhuo, Eugenio Pérez,
Martin K. Petersen, Keith Busch, Christoph Hellwig, Sagi Grimberg,
John Garry, Greg Kroah-Hartman, Hannes Reinecke, linux-block,
linux-kernel, linux-pci, virtualization, linux-scsi,
megaraidlinux.pdl, mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl,
storagedev, linux-nvme
On Thu, Nov 14, 2024 at 01:06:49PM +0100, Daniel Wagner wrote:
> Oh, I was not aware of this ordering. And after digging this up here:
>
> https://lore.kernel.org/all/20060105142951.13.01@flint.arm.linux.org.uk/
>
> I don't think we it's worthwhile to add the callback to device_driver
> just for hisi_sas_v2. So I am going to drop this part again.
Yes, I don't really see how querying driver specific information like
this from code called by the driver make much sense.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v4 05/10] blk-mq: introduce blk_mq_hctx_map_queues
2024-11-14 12:06 ` Daniel Wagner
2024-11-14 12:11 ` Christoph Hellwig
@ 2024-11-14 12:20 ` John Garry
1 sibling, 0 replies; 25+ messages in thread
From: John Garry @ 2024-11-14 12:20 UTC (permalink / raw)
To: Daniel Wagner, Ming Lei
Cc: Daniel Wagner, Jens Axboe, Bjorn Helgaas, Michael S. Tsirkin,
Jason Wang, Xuan Zhuo, Eugenio Pérez, Martin K. Petersen,
Keith Busch, Christoph Hellwig, Sagi Grimberg, Greg Kroah-Hartman,
Hannes Reinecke, linux-block, linux-kernel, linux-pci,
virtualization, linux-scsi, megaraidlinux.pdl,
mpi3mr-linuxdrv.pdl, MPT-FusionLinux.pdl, storagedev, linux-nvme
On 14/11/2024 12:06, Daniel Wagner wrote:
> On Thu, Nov 14, 2024 at 05:12:22PM +0800, Ming Lei wrote:
>> I feel driver should get higher priority, but in the probe() example,
>> call_driver_probe() actually tries bus->probe() first.
>>
>> But looks not an issue for this patchset since only hisi_sas_v2_driver(platform_driver)
>> defines ->irq_get_affinity(), but the platform_bus_type doesn't have
>> the callback.
> Oh, I was not aware of this ordering. And after digging this up here:
>
> https://urldefense.com/v3/__https://lore.kernel.org/
> all/20060105142951.13.01@flint.arm.linux.org.uk/__;!!ACWV5N9M2RV99hQ!
> IWDpRwKfvo0y1LzokS_0YDXzX7eZLeVUcaTOFCpn0yEcV2e5gknO2Q3igMwPhA1Mhq6IOKBOkiLxHYe-0sM$
>
> I don't think we it's worthwhile to add the callback to device_driver
> just for hisi_sas_v2. So I am going to drop this part again.
I agree. I would not add anything new to core code just for that driver.
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2024-11-14 12:21 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-13 14:26 [PATCH v4 00/10] blk: refactor queue affinity helpers Daniel Wagner
2024-11-13 14:26 ` [PATCH v4 01/10] driver core: bus: add irq_get_affinity callback to bus_type Daniel Wagner
2024-11-14 1:45 ` Ming Lei
2024-11-13 14:26 ` [PATCH v4 02/10] driver core: add irq_get_affinity callback device_driver Daniel Wagner
2024-11-14 1:52 ` Ming Lei
2024-11-14 7:06 ` Daniel Wagner
2024-11-13 14:26 ` [PATCH v4 03/10] PCI: hookup irq_get_affinity callback Daniel Wagner
2024-11-14 1:53 ` Ming Lei
2024-11-13 14:26 ` [PATCH v4 04/10] virtio: " Daniel Wagner
2024-11-14 1:54 ` Ming Lei
2024-11-13 14:26 ` [PATCH v4 05/10] blk-mq: introduce blk_mq_hctx_map_queues Daniel Wagner
2024-11-14 1:58 ` Ming Lei
2024-11-14 7:54 ` Daniel Wagner
2024-11-14 9:12 ` Ming Lei
2024-11-14 12:06 ` Daniel Wagner
2024-11-14 12:11 ` Christoph Hellwig
2024-11-14 12:20 ` John Garry
2024-11-13 14:26 ` [PATCH v4 06/10] scsi: replace blk_mq_pci_map_queues with blk_mq_hctx_map_queues Daniel Wagner
2024-11-13 14:26 ` [PATCH v4 07/10] scsi: hisi_sas: use blk_mq_hctx_map_queues to map queues Daniel Wagner
2024-11-14 0:36 ` kernel test robot
2024-11-14 7:08 ` Daniel Wagner
2024-11-14 3:28 ` kernel test robot
2024-11-13 14:26 ` [PATCH v4 08/10] nvme: replace blk_mq_pci_map_queues with blk_mq_hctx_map_queues Daniel Wagner
2024-11-13 14:26 ` [PATCH v4 09/10] virtio: blk/scsi: replace blk_mq_virtio_map_queues " Daniel Wagner
2024-11-13 14:26 ` [PATCH v4 10/10] blk-mq: remove unused queue mapping helpers Daniel Wagner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).