From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752781AbdH2LN4 (ORCPT ); Tue, 29 Aug 2017 07:13:56 -0400 Received: from terminus.zytor.com ([65.50.211.136]:46075 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751300AbdH2LNz (ORCPT ); Tue, 29 Aug 2017 07:13:55 -0400 Date: Tue, 29 Aug 2017 04:09:17 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: peterz@infradead.org, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, rostedt@goodmis.org, luto@kernel.org, bp@alien8.de, torvalds@linux-foundation.org, mingo@kernel.org Reply-To: mingo@kernel.org, torvalds@linux-foundation.org, luto@kernel.org, bp@alien8.de, tglx@linutronix.de, linux-kernel@vger.kernel.org, rostedt@goodmis.org, peterz@infradead.org, hpa@zytor.com In-Reply-To: <20170828064957.222101344@linutronix.de> References: <20170828064957.222101344@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/apic] x86/smp: Remove pointless duplicated interrupt code Git-Commit-ID: 85b77cdd8fbd163d65f340e3f6578c50031af960 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: 85b77cdd8fbd163d65f340e3f6578c50031af960 Gitweb: http://git.kernel.org/tip/85b77cdd8fbd163d65f340e3f6578c50031af960 Author: Thomas Gleixner AuthorDate: Mon, 28 Aug 2017 08:47:29 +0200 Committer: Ingo Molnar CommitDate: Tue, 29 Aug 2017 11:42:27 +0200 x86/smp: Remove pointless duplicated interrupt code Two NOP5s are really a good tradeoff vs. the unholy IDT switching mess, which duplicates code all over the place. The rescheduling interrupt gets optimized in a later step. Make the ordering of function call and statistics increment the same as in other places. Calculate stats first, then do the function call. Signed-off-by: Thomas Gleixner Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Link: http://lkml.kernel.org/r/20170828064957.222101344@linutronix.de Signed-off-by: Ingo Molnar --- arch/x86/include/asm/hw_irq.h | 4 ++-- arch/x86/kernel/smp.c | 43 +++++++------------------------------------ 2 files changed, 9 insertions(+), 38 deletions(-) diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h index 5f042ec..8fb6c22 100644 --- a/arch/x86/include/asm/hw_irq.h +++ b/arch/x86/include/asm/hw_irq.h @@ -49,8 +49,8 @@ extern asmlinkage void call_function_single_interrupt(void); #ifdef CONFIG_TRACING /* Interrupt handlers registered during init_IRQ */ extern void trace_reschedule_interrupt(void); -extern void trace_call_function_interrupt(void); -extern void trace_call_function_single_interrupt(void); +#define trace_call_function_interrupt call_function_interrupt +#define trace_call_function_single_interrupt call_function_single_interrupt #define trace_thermal_interrupt thermal_interrupt #define trace_threshold_interrupt threshold_interrupt #define trace_deferred_error_interrupt deferred_error_interrupt diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c index d798c0d..fb49e10 100644 --- a/arch/x86/kernel/smp.c +++ b/arch/x86/kernel/smp.c @@ -281,57 +281,28 @@ __visible void __irq_entry smp_trace_reschedule_interrupt(struct pt_regs *regs) */ ipi_entering_ack_irq(); trace_reschedule_entry(RESCHEDULE_VECTOR); - __smp_reschedule_interrupt(); + inc_irq_stat(irq_resched_count); + scheduler_ipi(); trace_reschedule_exit(RESCHEDULE_VECTOR); exiting_irq(); - /* - * KVM uses this interrupt to force a cpu out of guest mode - */ -} - -static inline void __smp_call_function_interrupt(void) -{ - generic_smp_call_function_interrupt(); - inc_irq_stat(irq_call_count); } __visible void __irq_entry smp_call_function_interrupt(struct pt_regs *regs) { ipi_entering_ack_irq(); - __smp_call_function_interrupt(); - exiting_irq(); -} - -__visible void __irq_entry -smp_trace_call_function_interrupt(struct pt_regs *regs) -{ - ipi_entering_ack_irq(); trace_call_function_entry(CALL_FUNCTION_VECTOR); - __smp_call_function_interrupt(); - trace_call_function_exit(CALL_FUNCTION_VECTOR); - exiting_irq(); -} - -static inline void __smp_call_function_single_interrupt(void) -{ - generic_smp_call_function_single_interrupt(); inc_irq_stat(irq_call_count); -} - -__visible void __irq_entry -smp_call_function_single_interrupt(struct pt_regs *regs) -{ - ipi_entering_ack_irq(); - __smp_call_function_single_interrupt(); + generic_smp_call_function_interrupt(); + trace_call_function_exit(CALL_FUNCTION_VECTOR); exiting_irq(); } -__visible void __irq_entry -smp_trace_call_function_single_interrupt(struct pt_regs *regs) +__visible void __irq_entry smp_call_function_single_interrupt(struct pt_regs *r) { ipi_entering_ack_irq(); trace_call_function_single_entry(CALL_FUNCTION_SINGLE_VECTOR); - __smp_call_function_single_interrupt(); + inc_irq_stat(irq_call_count); + generic_smp_call_function_single_interrupt(); trace_call_function_single_exit(CALL_FUNCTION_SINGLE_VECTOR); exiting_irq(); }