Re: [PATCH v7 08/10] blk-mq: use hk cpus only when isolcpus=io_queue is enabled
From: Daniel Wagner
Date: Fri Jul 04 2025 - 05:10:47 EST
On Thu, Jul 03, 2025 at 11:01:58AM +0200, Christoph Hellwig wrote:
> On Wed, Jul 02, 2025 at 06:33:58PM +0200, Daniel Wagner wrote:
> > const struct cpumask *blk_mq_possible_queue_affinity(void)
> > {
> > + if (housekeeping_enabled(HK_TYPE_IO_QUEUE))
> > + return housekeeping_cpumask(HK_TYPE_IO_QUEUE);
> > +
> > return cpu_possible_mask;
> > }
>
> I'm no expert on the housekeeping stuff, but why isn't the
> housekeeping_enabled check done in housekeeping_cpumask directly so
> that the drivers could use housekeeping_cpumask without a blk-mq
> wrapper?
Yes, housekeeping_cpumask will return cpu_possible_mask when housekeping
is disabled. Though some drivers want cpu_online_mask instead. If all
drivers would agree on one version of the mask it should allow to drop
to these helpers (maybe we the houskeeping API needs to be extended then
though)
This is also what Hannes brought up. If the number of supported hardware
queues for a device is less than cpu_possible_mask, it really makes
sense to distribute the hardware queues only between the online cpus. I
think the only two drivers which are interested in the cpu_possible_mask
are nvme-pci and virtio.