Re: [PATCH 02/13] irq: Introduce IRQD_AFFINITY_MANAGED flag

From: Christoph Hellwig
Date: Tue Jun 21 2016 - 10:32:27 EST


On Mon, Jun 20, 2016 at 03:21:47PM +0200, Bart Van Assche wrote:
> A notification mechanism that reports interrupt mapping changes will
> definitely help. What would also help is an API that allows drivers to
> query the MSI-X IRQ of an adapter that is nearest given a cpumask, e.g.
> hctx->cpumask.

This is still the wrong way around - we need to build the blk-mq queue
mappings based on the interrupts, not the other way around.

> Another function can then map that IRQ into an index in the
> range 0..n-1 where n is the number of MSI-X interrupts for that adapter.
> Every blk-mq/scsi-mq driver will need this functionality to decide which
> IRQ to associate with a block layer hctx.

This is something that should be done in commmon code and is done in
common code in this series - the driver passes a cpumask to blk-mq,
and blk-mq creates a queue for every cpu that is set in the cpumask.