From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753396AbdFVROV (ORCPT ); Thu, 22 Jun 2017 13:14:21 -0400 Received: from terminus.zytor.com ([65.50.211.136]:36817 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751193AbdFVROT (ORCPT ); Thu, 22 Jun 2017 13:14:19 -0400 Date: Thu, 22 Jun 2017 10:09:41 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: tglx@linutronix.de, axboe@kernel.dk, mpe@ellerman.id.au, peterz@infradead.org, hpa@zytor.com, marc.zyngier@arm.com, keith.busch@intel.com, linux-kernel@vger.kernel.org, mingo@kernel.org, hch@lst.de Reply-To: keith.busch@intel.com, hch@lst.de, mingo@kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, tglx@linutronix.de, peterz@infradead.org, mpe@ellerman.id.au, hpa@zytor.com, marc.zyngier@arm.com In-Reply-To: <20170619235447.431321047@linutronix.de> References: <20170619235447.431321047@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] genirq/cpuhotplug: Avoid irq affinity setting for single targets Git-Commit-ID: 8f31a9845db348f5781df47ce04c79e4cfe90016 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 8f31a9845db348f5781df47ce04c79e4cfe90016 Gitweb: http://git.kernel.org/tip/8f31a9845db348f5781df47ce04c79e4cfe90016 Author: Thomas Gleixner AuthorDate: Tue, 20 Jun 2017 01:37:53 +0200 Committer: Thomas Gleixner 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 Cc: Jens Axboe Cc: Marc Zyngier Cc: Michael Ellerman Cc: Keith Busch Cc: Peter Zijlstra Cc: Christoph Hellwig 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); }