All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Daniel Wagner <dwagner@suse.de>
Cc: "Daniel Wagner" <wagi@kernel.org>, "Jens Axboe" <axboe@kernel.dk>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"Keith Busch" <kbusch@kernel.org>,
	"Christoph Hellwig" <hch@lst.de>,
	"Sagi Grimberg" <sagi@grimberg.me>,
	"John Garry" <john.g.garry@oracle.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Hannes Reinecke" <hare@suse.de>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, virtualization@lists.linux.dev,
	linux-scsi@vger.kernel.org, megaraidlinux.pdl@broadcom.com,
	mpi3mr-linuxdrv.pdl@broadcom.com,
	MPT-FusionLinux.pdl@broadcom.com, storagedev@microchip.com,
	linux-nvme@lists.infradead.org
Subject: Re: [PATCH v4 05/10] blk-mq: introduce blk_mq_hctx_map_queues
Date: Thu, 14 Nov 2024 17:12:22 +0800	[thread overview]
Message-ID: <ZzW-9rWvKBxFZU1E@fedora> (raw)
In-Reply-To: <9fa26099-1922-4b99-883e-bd5f6c58162a@flourine.local>

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


  reply	other threads:[~2024-11-14  9:12 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZzW-9rWvKBxFZU1E@fedora \
    --to=ming.lei@redhat.com \
    --cc=MPT-FusionLinux.pdl@broadcom.com \
    --cc=axboe@kernel.dk \
    --cc=bhelgaas@google.com \
    --cc=dwagner@suse.de \
    --cc=eperezma@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=jasowang@redhat.com \
    --cc=john.g.garry@oracle.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=megaraidlinux.pdl@broadcom.com \
    --cc=mpi3mr-linuxdrv.pdl@broadcom.com \
    --cc=mst@redhat.com \
    --cc=sagi@grimberg.me \
    --cc=storagedev@microchip.com \
    --cc=virtualization@lists.linux.dev \
    --cc=wagi@kernel.org \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.