Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3cd788c1 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Ingo Molnar
Browse files

x86/smp: Use static key for reschedule interrupt tracing



It's worth to avoid the extra irq_enter()/irq_exit() pair in the case that
the reschedule interrupt tracepoints are disabled.

Use the static key which indicates that exception tracing is enabled. For
now this key is global. It will be optimized in a later step.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20170828064957.299808677@linutronix.de


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 85b77cdd
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -48,7 +48,7 @@ extern asmlinkage void call_function_single_interrupt(void);


#ifdef CONFIG_TRACING
#ifdef CONFIG_TRACING
/* Interrupt handlers registered during init_IRQ */
/* Interrupt handlers registered during init_IRQ */
extern void trace_reschedule_interrupt(void);
#define trace_reschedule_interrupt	reschedule_interrupt
#define trace_call_function_interrupt	call_function_interrupt
#define trace_call_function_interrupt	call_function_interrupt
#define trace_call_function_single_interrupt	call_function_single_interrupt
#define trace_call_function_single_interrupt	call_function_single_interrupt
#define trace_thermal_interrupt	thermal_interrupt
#define trace_thermal_interrupt	thermal_interrupt
+15 −25
Original line number Original line Diff line number Diff line
@@ -254,37 +254,27 @@ static void native_stop_other_cpus(int wait)
}
}


/*
/*
 * Reschedule call back.
 * Reschedule call back. KVM uses this interrupt to force a cpu out of
 * guest mode
 */
 */
static inline void __smp_reschedule_interrupt(void)
{
	inc_irq_stat(irq_resched_count);
	scheduler_ipi();
}

__visible void __irq_entry smp_reschedule_interrupt(struct pt_regs *regs)
__visible void __irq_entry smp_reschedule_interrupt(struct pt_regs *regs)
{
{
	ack_APIC_irq();
	ack_APIC_irq();
	__smp_reschedule_interrupt();
	inc_irq_stat(irq_resched_count);
	/*
	 * KVM uses this interrupt to force a cpu out of guest mode
	 */
}


__visible void __irq_entry smp_trace_reschedule_interrupt(struct pt_regs *regs)
	if (trace_irqvectors_enabled()) {
{
		/*
		/*
	 * Need to call irq_enter() before calling the trace point.
		 * scheduler_ipi() might call irq_enter() as well, but
	 * __smp_reschedule_interrupt() calls irq_enter/exit() too (in
		 * nested calls are fine.
	 * scheduler_ipi(). This is OK, since those functions are allowed
	 * to nest.
		 */
		 */
	ipi_entering_ack_irq();
		irq_enter();
		trace_reschedule_entry(RESCHEDULE_VECTOR);
		trace_reschedule_entry(RESCHEDULE_VECTOR);
	inc_irq_stat(irq_resched_count);
		scheduler_ipi();
		scheduler_ipi();
		trace_reschedule_exit(RESCHEDULE_VECTOR);
		trace_reschedule_exit(RESCHEDULE_VECTOR);
	exiting_irq();
		irq_exit();
		return;
	}
	scheduler_ipi();
}
}


__visible void __irq_entry smp_call_function_interrupt(struct pt_regs *regs)
__visible void __irq_entry smp_call_function_interrupt(struct pt_regs *regs)