From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753604AbdFVRHd (ORCPT ); Thu, 22 Jun 2017 13:07:33 -0400 Received: from terminus.zytor.com ([65.50.211.136]:59349 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753301AbdFVRHb (ORCPT ); Thu, 22 Jun 2017 13:07:31 -0400 Date: Thu, 22 Jun 2017 10:01:53 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: mingo@kernel.org, mpe@ellerman.id.au, keith.busch@intel.com, peterz@infradead.org, hch@lst.de, tglx@linutronix.de, linux-kernel@vger.kernel.org, axboe@kernel.dk, marc.zyngier@arm.com, hpa@zytor.com Reply-To: linux-kernel@vger.kernel.org, axboe@kernel.dk, tglx@linutronix.de, hch@lst.de, peterz@infradead.org, keith.busch@intel.com, hpa@zytor.com, marc.zyngier@arm.com, mingo@kernel.org, mpe@ellerman.id.au In-Reply-To: <20170619235446.328488490@linutronix.de> References: <20170619235446.328488490@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] genirq/cpuhotplug: Use effective affinity mask Git-Commit-ID: 415fcf1a2293046e0c1f4ab8558a87bad66652b1 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: 415fcf1a2293046e0c1f4ab8558a87bad66652b1 Gitweb: http://git.kernel.org/tip/415fcf1a2293046e0c1f4ab8558a87bad66652b1 Author: Thomas Gleixner AuthorDate: Tue, 20 Jun 2017 01:37:39 +0200 Committer: Thomas Gleixner CommitDate: Thu, 22 Jun 2017 18:21:21 +0200 genirq/cpuhotplug: Use effective affinity mask If the architecture supports the effective affinity mask, migrating interrupts away which are not targeted by the effective mask is pointless. They can stay in the user or system supplied affinity mask, but won't be targetted at any given point as the affinity setter functions need to validate against the online cpu mask anyway. 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/20170619235446.328488490@linutronix.de --- kernel/irq/cpuhotplug.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c index e09cb91..0b093db 100644 --- a/kernel/irq/cpuhotplug.c +++ b/kernel/irq/cpuhotplug.c @@ -14,6 +14,14 @@ #include "internals.h" +/* For !GENERIC_IRQ_EFFECTIVE_AFF_MASK this looks at general affinity mask */ +static inline bool irq_needs_fixup(struct irq_data *d) +{ + const struct cpumask *m = irq_data_get_effective_affinity_mask(d); + + return cpumask_test_cpu(smp_processor_id(), m); +} + static bool migrate_one_irq(struct irq_desc *desc) { struct irq_data *d = irq_desc_get_irq_data(desc); @@ -42,9 +50,7 @@ static bool migrate_one_irq(struct irq_desc *desc) * Note: Do not check desc->action as this might be a chained * interrupt. */ - affinity = irq_data_get_affinity_mask(d); - if (irqd_is_per_cpu(d) || !irqd_is_started(d) || - !cpumask_test_cpu(smp_processor_id(), affinity)) { + if (irqd_is_per_cpu(d) || !irqd_is_started(d) || !irq_needs_fixup(d)) { /* * If an irq move is pending, abort it if the dying CPU is * the sole target. @@ -69,6 +75,8 @@ static bool migrate_one_irq(struct irq_desc *desc) */ if (irq_fixup_move_pending(desc, true)) affinity = irq_desc_get_pending_mask(desc); + else + affinity = irq_data_get_affinity_mask(d); /* Mask the chip for interrupts which cannot move in process context */ if (maskchip && chip->irq_mask)