From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753515AbdFVRDJ (ORCPT ); Thu, 22 Jun 2017 13:03:09 -0400 Received: from terminus.zytor.com ([65.50.211.136]:59715 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752669AbdFVRDH (ORCPT ); Thu, 22 Jun 2017 13:03:07 -0400 Date: Thu, 22 Jun 2017 09:58:23 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: hpa@zytor.com, marc.zyngier@arm.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, peterz@infradead.org, mpe@ellerman.id.au, hch@lst.de, axboe@kernel.dk, keith.busch@intel.com, mingo@kernel.org Reply-To: keith.busch@intel.com, mingo@kernel.org, hch@lst.de, axboe@kernel.dk, peterz@infradead.org, linux-kernel@vger.kernel.org, mpe@ellerman.id.au, tglx@linutronix.de, hpa@zytor.com, marc.zyngier@arm.com In-Reply-To: <20170619235445.851311033@linutronix.de> References: <20170619235445.851311033@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] x86/irq: Use irq_migrate_all_off_this_cpu() Git-Commit-ID: ad7a929fa4bb1143357aa83043a149d5c27c68fd 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: ad7a929fa4bb1143357aa83043a149d5c27c68fd Gitweb: http://git.kernel.org/tip/ad7a929fa4bb1143357aa83043a149d5c27c68fd Author: Thomas Gleixner AuthorDate: Tue, 20 Jun 2017 01:37:33 +0200 Committer: Thomas Gleixner CommitDate: Thu, 22 Jun 2017 18:21:18 +0200 x86/irq: Use irq_migrate_all_off_this_cpu() The generic migration code supports all the required features already. Remove the x86 specific implementation and use the generic one. 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/20170619235445.851311033@linutronix.de --- arch/x86/Kconfig | 1 + arch/x86/kernel/irq.c | 89 ++------------------------------------------------- 2 files changed, 3 insertions(+), 87 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 0efb4c9..fcf1dad 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -87,6 +87,7 @@ config X86 select GENERIC_EARLY_IOREMAP select GENERIC_FIND_FIRST_BIT select GENERIC_IOMAP + select GENERIC_IRQ_MIGRATION if SMP select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW select GENERIC_PENDING_IRQ if SMP diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 78bd2b8..4aa03c5 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -432,95 +432,12 @@ int check_irq_vectors_for_cpu_disable(void) /* A cpu has been removed from cpu_online_mask. Reset irq affinities. */ void fixup_irqs(void) { - unsigned int irq, vector; + unsigned int irr, vector; struct irq_desc *desc; struct irq_data *data; struct irq_chip *chip; - int ret; - for_each_irq_desc(irq, desc) { - const struct cpumask *affinity; - bool break_affinity = false; - - if (!desc) - continue; - - /* interrupt's are disabled at this point */ - raw_spin_lock(&desc->lock); - - data = irq_desc_get_irq_data(desc); - chip = irq_data_get_irq_chip(data); - /* - * The interrupt descriptor might have been cleaned up - * already, but it is not yet removed from the radix - * tree. If the chip does not have an affinity setter, - * nothing to do here. - */ - if (!chip && !chip->irq_set_affinity) { - raw_spin_unlock(&desc->lock); - continue; - } - - affinity = irq_data_get_affinity_mask(data); - - if (!irq_has_action(irq) || irqd_is_per_cpu(data) || - cpumask_subset(affinity, cpu_online_mask)) { - irq_fixup_move_pending(desc, false); - raw_spin_unlock(&desc->lock); - continue; - } - - /* - * Complete an eventually pending irq move cleanup. If this - * interrupt was moved in hard irq context, then the - * vectors need to be cleaned up. It can't wait until this - * interrupt actually happens and this CPU was involved. - */ - irq_force_complete_move(desc); - - /* - * If there is a setaffinity pending, then try to reuse the - * pending mask, so the last change of the affinity does - * not get lost. If there is no move pending or the pending - * mask does not contain any online CPU, use the current - * affinity mask. - */ - if (irq_fixup_move_pending(desc, true)) - affinity = desc->pending_mask; - - /* - * If the mask does not contain an offline CPU, break - * affinity and use cpu_online_mask as fall back. - */ - if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) { - broke_affinity = true; - affinity = cpu_online_mask; - } - - if (!irqd_can_move_in_process_context(data) && chip->irq_mask) - chip->irq_mask(data); - - ret = chip->irq_set_affinity(data, affinity, true); - if (ret) { - pr_crit("IRQ %u: Force affinity failed (%d)\n", - d->irq, ret); - broke_affinity = false; - } - - /* - * We unmask if the irq was not marked masked by the - * core code. That respects the lazy irq disable - * behaviour. - */ - if (!irqd_can_move_in_process_context(data) && - !irqd_irq_masked(data) && chip->irq_unmask) - chip->irq_unmask(data); - - raw_spin_unlock(&desc->lock); - - if (broke_affinity) - pr_notice("Broke affinity for irq %i\n", irq); - } + irq_migrate_all_off_this_cpu(); /* * We can remove mdelay() and then send spuriuous interrupts to @@ -539,8 +456,6 @@ void fixup_irqs(void) * nothing else will touch it. */ for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) { - unsigned int irr; - if (IS_ERR_OR_NULL(__this_cpu_read(vector_irq[vector]))) continue;