From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753875AbbLaQb6 (ORCPT ); Thu, 31 Dec 2015 11:31:58 -0500 Received: from www.linutronix.de ([62.245.132.108]:46708 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750726AbbLaQbs (ORCPT ); Thu, 31 Dec 2015 11:31:48 -0500 Message-Id: <20151231160107.045961667@linutronix.de> User-Agent: quilt/0.63-1 Date: Thu, 31 Dec 2015 16:30:52 -0000 From: Thomas Gleixner To: LKML Cc: Ingo Molnar , Peter Anvin , Jiang Liu , Joe Lawrence , Jeremiah Mahler , Borislav Petkov , andy.shevchenko@gmail.com, Guenter Roeck Subject: [patch 12/14] x86/irq: Remove outgoing CPU from vector cleanup mask References: <20151231155849.772553760@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Disposition: inline; filename=x86-irq--Remove-outgoing-CPU-from-vector-cleanup-mask.patch X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001,URIBL_BLOCKED=0.001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We want to synchronize new vector assignments with a pending cleanup. Remove a dying cpu from a pending cleanup mask. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/apic/vector.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) --- a/arch/x86/kernel/apic/vector.c +++ b/arch/x86/kernel/apic/vector.c @@ -631,9 +631,23 @@ void irq_complete_move(struct irq_cfg *c void irq_force_complete_move(int irq) { struct irq_cfg *cfg = irq_cfg(irq); + struct apic_chip_data *data; - if (cfg) - __irq_complete_move(cfg, cfg->vector); + if (!cfg) + return; + + __irq_complete_move(cfg, cfg->vector); + + /* + * Remove this cpu from the cleanup mask. The IPI might have been sent + * just before the cpu was removed from the offline mask, but has not + * been processed because the CPU has interrupts disabled and is on + * the way out. + */ + raw_spin_lock(&vector_lock); + data = container_of(cfg, struct apic_chip_data, cfg); + cpumask_clear_cpu(smp_processor_id(), data->old_domain); + raw_spin_unlock(&vector_lock); } #endif