提交 cbf86999 编写于 作者: T Thomas Gleixner

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: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Tested-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
上级 7928b2cb
...@@ -855,10 +855,14 @@ irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action) ...@@ -855,10 +855,14 @@ irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action)
* This code is triggered unconditionally. Check the affinity * This code is triggered unconditionally. Check the affinity
* mask pointer. For CPU_MASK_OFFSTACK=n this is optimized out. * mask pointer. For CPU_MASK_OFFSTACK=n this is optimized out.
*/ */
if (cpumask_available(desc->irq_common_data.affinity)) if (cpumask_available(desc->irq_common_data.affinity)) {
cpumask_copy(mask, desc->irq_common_data.affinity); const struct cpumask *m;
else
m = irq_data_get_effective_affinity_mask(&desc->irq_data);
cpumask_copy(mask, m);
} else {
valid = false; valid = false;
}
raw_spin_unlock_irq(&desc->lock); raw_spin_unlock_irq(&desc->lock);
if (valid) if (valid)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册