Skip to content

Commit 8f31a98

Browse files
committed
genirq/cpuhotplug: Avoid irq affinity setting for single targets
Avoid trying to add a newly online CPU to the effective affinity mask of an started up interrupt. That interrupt will either stay on the already online CPU or move around for no value. 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/20170619235447.431321047@linutronix.de
1 parent d52dd44 commit 8f31a98

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

kernel/irq/cpuhotplug.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,17 @@ static void irq_restore_affinity_of_irq(struct irq_desc *desc, unsigned int cpu)
148148
!irq_data_get_irq_chip(data) || !cpumask_test_cpu(cpu, affinity))
149149
return;
150150

151-
if (irqd_is_managed_and_shutdown(data))
151+
if (irqd_is_managed_and_shutdown(data)) {
152152
irq_startup(desc, IRQ_RESEND, IRQ_START_COND);
153-
else
153+
return;
154+
}
155+
156+
/*
157+
* If the interrupt can only be directed to a single target
158+
* CPU then it is already assigned to a CPU in the affinity
159+
* mask. No point in trying to move it around.
160+
*/
161+
if (!irqd_is_single_target(data))
154162
irq_set_affinity_locked(data, affinity, false);
155163
}
156164

0 commit comments

Comments
 (0)