Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1721116

[patch V3 14/44] x86/smp: Remove pointless duplicated interrupt code

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject [patch V3 14/44] x86/smp: Remove pointless duplicated interrupt code
Date 2017-08-28 09:10 +0200
Message-ID <ujmlm-2xk-75@gated-at.bofh.it> (permalink)
References <ujmbD-2dY-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Two NOP5 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. stats first, then function call.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/include/asm/hw_irq.h |    4 +--
 arch/x86/kernel/smp.c         |   43 ++++++------------------------------------
 2 files changed, 9 insertions(+), 38 deletions(-)

--- 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_sin
 #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
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -281,57 +281,28 @@ static inline void __smp_reschedule_inte
 	 */
 	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();
 }

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[patch V3 00/44] x86: Cleanup IDT code Thomas Gleixner <tglx@linutronix.de> - 2017-08-28 09:10 +0200
  [patch V3 13/44] x86/mce: Remove duplicated tracing interrupt code Thomas Gleixner <tglx@linutronix.de> - 2017-08-28 09:10 +0200
    [tip:x86/apic] x86/mce: Remove duplicated tracing interrupt code tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-08-29 13:20 +0200
  [patch V3 05/44] x86/boot: Move EISA setup to a proper place Thomas Gleixner <tglx@linutronix.de> - 2017-08-28 09:10 +0200
    [tip:x86/apic] x86/boot: Move EISA setup to a separate file tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-08-29 13:20 +0200
  [patch V3 15/44] x86/smp: Use static key for reschedule interrupt  tracing Thomas Gleixner <tglx@linutronix.de> - 2017-08-28 09:10 +0200
    [tip:x86/apic] x86/smp: Use static key for reschedule interrupt  tracing tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-08-29 13:20 +0200
  [patch V3 12/44] x86/irqwork: Get rid of duplicated tracing interrupt  code Thomas Gleixner <tglx@linutronix.de> - 2017-08-28 09:10 +0200
    [tip:x86/apic] x86/irqwork: Get rid of duplicated tracing interrupt  code tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-08-29 13:20 +0200
  [patch V3 10/44] x86/irq: Get rid of duplicated  trace_x86_platform_ipi() code Thomas Gleixner <tglx@linutronix.de> - 2017-08-28 09:10 +0200
    [tip:x86/apic] x86/irq: Get rid of duplicated  trace_x86_platform_ipi() code tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-08-29 13:20 +0200
  [patch V3 06/44] x86/tracing: Introduce a static key for exception  tracing Thomas Gleixner <tglx@linutronix.de> - 2017-08-28 09:10 +0200
    [tip:x86/apic] x86/tracing: Introduce a static key for exception  tracing tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-08-29 13:20 +0200
  [patch V3 08/44] x86/apic: Remove the duplicated tracing version of  local_timer_interrupt Thomas Gleixner <tglx@linutronix.de> - 2017-08-28 09:10 +0200
    [tip:x86/apic] x86/apic: Remove the duplicated tracing version of  local_timer_interrupt() tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-08-29 13:20 +0200
  [patch V3 14/44] x86/smp: Remove pointless duplicated interrupt code Thomas Gleixner <tglx@linutronix.de> - 2017-08-28 09:10 +0200
    [tip:x86/apic] x86/smp: Remove pointless duplicated interrupt code tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-08-29 13:20 +0200
  [patch V3 04/44] x86/irq: Remove duplicated used_vectors definition Thomas Gleixner <tglx@linutronix.de> - 2017-08-28 09:10 +0200
    [tip:x86/apic] x86/irq: Remove duplicated used_vectors definition tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-08-29 13:20 +0200
  [patch V3 03/44] x86/irq: Get rid of the first_system_vector bogisity Thomas Gleixner <tglx@linutronix.de> - 2017-08-28 09:10 +0200
    [tip:x86/apic] x86/irq: Get rid of the 'first_system_vector'  indirection bogosity tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-08-29 13:20 +0200
  [patch V3 28/44] x86/idt: Create file for IDT related code Thomas Gleixner <tglx@linutronix.de> - 2017-08-28 09:10 +0200
    [tip:x86/apic] x86/idt: Create file for IDT related code tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-08-29 13:30 +0200

csiph-web