path: root/include/linux/irq.h
diff options
authorThomas Gleixner <tglx@linutronix.de>2017-06-20 01:37:38 +0200
committerThomas Gleixner <tglx@linutronix.de>2017-06-22 18:21:20 +0200
commit0d3f54257dc300f2db480d6a46b34bdb87f18c1b (patch)
treef989dcf40159e1d77ca900dc6f9d42989df403e4 /include/linux/irq.h
parentc1a80386965e9fa3c2f8d1d57966216fe02c9124 (diff)
genirq: Introduce effective affinity mask
There is currently no way to evaluate the effective affinity mask of a given interrupt. Many irq chips allow only a single target CPU or a subset of CPUs in the affinity mask. Updating the mask at the time of setting the affinity to the subset would be counterproductive because information for cpu hotplug about assigned interrupt affinities gets lost. On CPU hotplug it's also pointless to force migrate an interrupt, which is not targeted at the CPU effectively. But currently the information is not available. Provide a seperate mask to be updated by the irq_chip->irq_set_affinity() implementations. Implement the read only proc files so the user can see the effective mask as well w/o trying to deduce it from /proc/interrupts. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Jens Axboe <axboe@kernel.dk> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Keith Busch <keith.busch@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Christoph Hellwig <hch@lst.de> Link: http://lkml.kernel.org/r/20170619235446.247834245@linutronix.de
Diffstat (limited to 'include/linux/irq.h')
1 files changed, 29 insertions, 0 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 2b7e5a70d05f..4087ef268ba9 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -137,6 +137,9 @@ struct irq_domain;
* @affinity: IRQ affinity on SMP. If this is an IPI
* related irq, then this is the mask of the
* CPUs to which an IPI can be sent.
+ * @effective_affinity: The effective IRQ affinity on SMP as some irq
+ * chips do not allow multi CPU destinations.
+ * A subset of @affinity.
* @msi_desc: MSI descriptor
* @ipi_offset: Offset of first IPI target cpu in @affinity. Optional.
@@ -148,6 +151,9 @@ struct irq_common_data {
void *handler_data;
struct msi_desc *msi_desc;
cpumask_var_t affinity;
+ cpumask_var_t effective_affinity;
unsigned int ipi_offset;
@@ -737,6 +743,29 @@ static inline struct cpumask *irq_data_get_affinity_mask(struct irq_data *d)
return d->common->affinity;
+static inline
+struct cpumask *irq_data_get_effective_affinity_mask(struct irq_data *d)
+ return d->common->effective_affinity;
+static inline void irq_data_update_effective_affinity(struct irq_data *d,
+ const struct cpumask *m)
+ cpumask_copy(d->common->effective_affinity, m);
+static inline void irq_data_update_effective_affinity(struct irq_data *d,
+ const struct cpumask *m)
+static inline
+struct cpumask *irq_data_get_effective_affinity_mask(struct irq_data *d)
+ return d->common->affinity;
unsigned int arch_dynirq_lower_bound(unsigned int from);
int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,