summaryrefslogtreecommitdiffstats
path: root/kernel/irq/manage.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2018-02-16 09:21:20 -0500
committerThomas Gleixner <tglx@linutronix.de>2018-02-16 09:28:50 -0500
commitcbf8699996a6e7f2f674b3a2a4cef9f666ff613e (patch)
treebd662d2061f90832d1bc26e47033f00d13585901 /kernel/irq/manage.c
parent7928b2cbe55b2a410a0f5c1f154610059c57b1b2 (diff)
genirq: Let irq thread follow the effective hard irq affinity
In case of threaded interrupts the thread follows the affinity setting of the hard interrupt. The related function uses the affinity mask which was set by either from user space or via one of the kernel mechanisms. This mask can be wider than the resulting effective affinity of the hard interrupt. As a consequence the thread might become affine to a completely different CPU. Use the effective interrupt affinity if the architecture supports it, so the hard interrupt and the thread stay on the same CPU. Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r--kernel/irq/manage.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 0f922729bab9..d2b3c59f1200 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -855,10 +855,14 @@ irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action)
855 * This code is triggered unconditionally. Check the affinity 855 * This code is triggered unconditionally. Check the affinity
856 * mask pointer. For CPU_MASK_OFFSTACK=n this is optimized out. 856 * mask pointer. For CPU_MASK_OFFSTACK=n this is optimized out.
857 */ 857 */
858 if (cpumask_available(desc->irq_common_data.affinity)) 858 if (cpumask_available(desc->irq_common_data.affinity)) {
859 cpumask_copy(mask, desc->irq_common_data.affinity); 859 const struct cpumask *m;
860 else 860
861 m = irq_data_get_effective_affinity_mask(&desc->irq_data);
862 cpumask_copy(mask, m);
863 } else {
861 valid = false; 864 valid = false;
865 }
862 raw_spin_unlock_irq(&desc->lock); 866 raw_spin_unlock_irq(&desc->lock);
863 867
864 if (valid) 868 if (valid)