[PATCH v4 05/10] blk-mq: introduce blk_mq_hctx_map_queues

Daniel Wagner dwagner at suse.de
Thu Nov 14 04:06:49 PST 2024


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.



More information about the Linux-nvme mailing list