[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5967d256-037e-4ac8-a509-c6955b03db05@flourine.local>
Date: Tue, 12 Nov 2024 17:15:31 +0100
From: Daniel Wagner <dwagner@...e.de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Daniel Wagner <wagi@...nel.org>, Jens Axboe <axboe@...nel.dk>,
Bjorn Helgaas <bhelgaas@...gle.com>, "Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>, Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Eugenio PĂ©rez <eperezma@...hat.com>, "Martin K. Petersen" <martin.petersen@...cle.com>,
Keith Busch <kbusch@...nel.org>, Christoph Hellwig <hch@....de>, Sagi Grimberg <sagi@...mberg.me>,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
virtualization@...ts.linux.dev, linux-scsi@...r.kernel.org, megaraidlinux.pdl@...adcom.com,
mpi3mr-linuxdrv.pdl@...adcom.com, MPT-FusionLinux.pdl@...adcom.com, storagedev@...rochip.com,
linux-nvme@...ts.infradead.org
Subject: Re: [PATCH v3 4/8] blk-mp: introduce blk_mq_hctx_map_queues
On Tue, Nov 12, 2024 at 04:42:40PM +0100, Greg Kroah-Hartman wrote:
> On Tue, Nov 12, 2024 at 04:33:09PM +0100, Daniel Wagner wrote:
> > On Tue, Nov 12, 2024 at 02:58:43PM +0100, Greg Kroah-Hartman wrote:
> > > > +void blk_mq_hctx_map_queues(struct blk_mq_queue_map *qmap,
> > > > + struct device *dev, unsigned int offset)
> > > > +
> > > > +{
> > > > + const struct cpumask *mask;
> > > > + unsigned int queue, cpu;
> > > > +
> > > > + if (!dev->bus->irq_get_affinity)
> > > > + goto fallback;
> > >
> > > I think this is better than hard-coding it, but are you sure that the
> > > bus will always be bound to the device here so that you have a valid
> > > bus-> pointer?
> >
> > No, I just assumed the bus pointer is always valid. If it is possible to
> > have a device without a bus, than I'll better extend the condition to
> >
> > if (!dev->bus || !dev->bus->irq_get_affinity)
> > goto fallback;
>
> I don't know if it's possible as I don't know what codepaths are calling
> this, it was hard to unwind. But you should check "just to be safe" :)
The main path to map_queues is via the probe functions. There are some
more paths like when updating a tagset after the number of queues but
that is all after the probe function.
nvme_probe
nvme_alloc_admin_tag_set
blk_mq_alloc_tag_set
blk_mq_update_queue_map
set->ops->map_queues
blk_mq_htcx_map_queues
nvme_alloc_io_tag_set
blk_mq_alloc_tag_set
blk_mq_update_queue_map
set->ops->map_queues
blk_mq_htcx_map_queues
virtscsi_probe, hisi_sas_v3_probe, ...
scsi_add_host
scsi_add_host_with_dma
scsi_mq_setup_tags
blk_mq_alloc_tag_set
blk_mq_update_queue_map
set->ops->map_queues
blk_mq_htcx_map_queues
virtblk_probe
blk_mq_alloc_tag_set
blk_mq_update_queue_map
set->ops->map_queues
blk_mq_htcx_map_queues
Does this help?
Powered by blists - more mailing lists