Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1670064 > unrolled thread

[patch 53/55] genirq/cpuhotplug: Avoid irq affinity setting for single targets

Started byThomas Gleixner <tglx@linutronix.de>
First post2017-06-20 02:10 +0200
Last post2017-06-22 19:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [patch 53/55] genirq/cpuhotplug: Avoid irq affinity setting for  single targets Thomas Gleixner <tglx@linutronix.de> - 2017-06-20 02:10 +0200
    [tip:irq/core] genirq/cpuhotplug: Avoid irq affinity setting for  single targets tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-06-22 19:20 +0200

#1670064 — [patch 53/55] genirq/cpuhotplug: Avoid irq affinity setting for single targets

FromThomas Gleixner <tglx@linutronix.de>
Date2017-06-20 02:10 +0200
Subject[patch 53/55] genirq/cpuhotplug: Avoid irq affinity setting for single targets
Message-ID<tUeU2-1fU-15@gated-at.bofh.it>
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>
---
 kernel/irq/cpuhotplug.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

--- a/kernel/irq/cpuhotplug.c
+++ b/kernel/irq/cpuhotplug.c
@@ -148,9 +148,17 @@ static void irq_restore_affinity_of_irq(
 	    !irq_data_get_irq_chip(data) || !cpumask_test_cpu(cpu, affinity))
 		return;
 
-	if (irqd_is_managed_and_shutdown(data))
+	if (irqd_is_managed_and_shutdown(data)) {
 		irq_startup(desc, IRQ_RESEND, IRQ_START_COND);
-	else
+		return;
+	}
+
+	/*
+	 * If the interrupt can only be directed to a single target
+	 * CPU then it is already assigned to a CPU in the affinity
+	 * mask. No point in trying to move it around.
+	 */
+	if (!irqd_is_single_target(data))
 		irq_set_affinity_locked(data, affinity, false);
 }
 

[toc] | [next] | [standalone]


#1672896 — [tip:irq/core] genirq/cpuhotplug: Avoid irq affinity setting for single targets

Fromtip-bot for Thomas Gleixner <tipbot@zytor.com>
Date2017-06-22 19:20 +0200
Subject[tip:irq/core] genirq/cpuhotplug: Avoid irq affinity setting for single targets
Message-ID<tVdVV-7HO-55@gated-at.bofh.it>
In reply to#1670064
Commit-ID:  8f31a9845db348f5781df47ce04c79e4cfe90016
Gitweb:     http://git.kernel.org/tip/8f31a9845db348f5781df47ce04c79e4cfe90016
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Tue, 20 Jun 2017 01:37:53 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 22 Jun 2017 18:21:25 +0200

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

---
 kernel/irq/cpuhotplug.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c
index b7964e7..aee8f7e 100644
--- a/kernel/irq/cpuhotplug.c
+++ b/kernel/irq/cpuhotplug.c
@@ -148,9 +148,17 @@ static void irq_restore_affinity_of_irq(struct irq_desc *desc, unsigned int cpu)
 	    !irq_data_get_irq_chip(data) || !cpumask_test_cpu(cpu, affinity))
 		return;
 
-	if (irqd_is_managed_and_shutdown(data))
+	if (irqd_is_managed_and_shutdown(data)) {
 		irq_startup(desc, IRQ_RESEND, IRQ_START_COND);
-	else
+		return;
+	}
+
+	/*
+	 * If the interrupt can only be directed to a single target
+	 * CPU then it is already assigned to a CPU in the affinity
+	 * mask. No point in trying to move it around.
+	 */
+	if (!irqd_is_single_target(data))
 		irq_set_affinity_locked(data, affinity, false);
 }
 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web