[PATCH v12 05/13] blk-mq: add blk_mq_{online|possible}_queue_affinity

Aaron Tomlin atomlin at atomlin.com
Tue May 5 13:55:44 PDT 2026


On Mon, Apr 27, 2026 at 05:34:16PM +0200, Sebastian Andrzej Siewior wrote:
> On 2026-04-22 14:52:07 [-0400], Aaron Tomlin wrote:
> > From: Daniel Wagner <wagi at kernel.org>
> > 
> > Introduce blk_mq_{online|possible}_queue_affinity, which returns the
> > queue-to-CPU mapping constraints defined by the block layer. This allows
> > other subsystems (e.g., IRQ affinity setup) to respect block layer
> > requirements.
> > 
> > It is necessary to provide versions for both the online and possible CPU
> > masks because some drivers want to spread their I/O queues only across
> > online CPUs, while others prefer to use all possible CPUs. And the mask
> > used needs to match with the number of queues requested
> > (see blk_num_{online|possible}_queues).
> 
> Which driver uses cpu_possible_mask? This mask is assigned at boot time
> once the kernel figured how many CPUs are possible based on ACPI or
> whatever the system uses. This mask does not change.
> 
> I only see drivers/scsi/lpfc/lpfc_init.c using it. Looking at
> cpu_possible_mask might not be the right thing. It is usually the same
> thing as "online" except on system where ACPI thinks that something
> could be added via hotplug _or_ if the admin shuts down a CPU via
> cpuhotplug _or_ boots with less (there a command line option for that). 
> 
> In case cpu_possible_mask != cpu_online_mask the intention is to
> allocate memory and setup irqs for the offline CPUs?
> 
> > Signed-off-by: Daniel Wagner <wagi at kernel.org>
> > Reviewed-by: Hannes Reinecke <hare at suse.de>
> > Signed-off-by: Aaron Tomlin <atomlin at atomlin.com>
> 
Hi Sebastian,

In the next iteration, this patch will be dropped. Moving forward, there
will be no more consumers of blk_mq_[online|possible]_queue_affinity().

Please see here [1]. 

[1]: https://lore.kernel.org/lkml/bnklzljfve53m33xdxv4mlu75kqrkpc3xooxgd3pnbvwjst5hr@btomkooj4crh/

-- 
Aaron Tomlin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20260505/1433a81e/attachment-0001.sig>


More information about the Linux-nvme mailing list