aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/interrupt.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-07-04 04:39:27 -0400
committerThomas Gleixner <tglx@linutronix.de>2016-07-04 06:25:14 -0400
commit5e385a6ef31fbbf2acbda770aecc2bc2ff933d17 (patch)
tree2845d6e1d4633d50683a07d0c2bebafc990c7b2a /include/linux/interrupt.h
parent0972fa57f53525ffa6ced12d703750fc2791e3ce (diff)
genirq: Add a helper to spread an affinity mask for MSI/MSI-X vectors
This is lifted from the blk-mq code and adopted to use the affinity mask concept just introduced in the irq handling code. It tries to keep the algorithm the same as the one current used by blk-mq, but improvements like assining vectors on a per-node basis instead of just per sibling are possible with this simple move and refactoring. Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: linux-block@vger.kernel.org Cc: linux-pci@vger.kernel.org Cc: linux-nvme@lists.infradead.org Cc: axboe@fb.com Cc: agordeev@redhat.com Link: http://lkml.kernel.org/r/1467621574-8277-7-git-send-email-hch@lst.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/interrupt.h')
-rw-r--r--include/linux/interrupt.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 9fcabeb07787..b6683f0ffc9f 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -278,6 +278,8 @@ extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m);
278extern int 278extern int
279irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify); 279irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify);
280 280
281struct cpumask *irq_create_affinity_mask(unsigned int *nr_vecs);
282
281#else /* CONFIG_SMP */ 283#else /* CONFIG_SMP */
282 284
283static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m) 285static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m)
@@ -308,6 +310,12 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify)
308{ 310{
309 return 0; 311 return 0;
310} 312}
313
314static inline struct cpumask *irq_create_affinity_mask(unsigned int *nr_vecs)
315{
316 *nr_vecs = 1;
317 return NULL;
318}
311#endif /* CONFIG_SMP */ 319#endif /* CONFIG_SMP */
312 320
313/* 321/*