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


Groups > linux.kernel > #1721104

[patch V3 09/44] x86/apic: Use this_cpu_ptr in local_timer_interrupt

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject [patch V3 09/44] x86/apic: Use this_cpu_ptr in local_timer_interrupt
Date 2017-08-28 09:10 +0200
Message-ID <ujmll-2xk-25@gated-at.bofh.it> (permalink)
References <ujmbD-2dY-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Accessing the per cpu data via per_cpu(, smp_processor_id()) is
pointless. Use this_cpu_ptr() instead.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/apic/apic.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -988,8 +988,7 @@ void setup_secondary_APIC_clock(void)
  */
 static void local_apic_timer_interrupt(void)
 {
-	int cpu = smp_processor_id();
-	struct clock_event_device *evt = &per_cpu(lapic_events, cpu);
+	struct clock_event_device *evt = this_cpu_ptr(&lapic_events);
 
 	/*
 	 * Normally we should not be here till LAPIC has been initialized but
@@ -1003,7 +1002,8 @@ static void local_apic_timer_interrupt(v
 	 * spurious.
 	 */
 	if (!evt->event_handler) {
-		pr_warning("Spurious LAPIC timer interrupt on cpu %d\n", cpu);
+		pr_warning("Spurious LAPIC timer interrupt on cpu %d\n",
+			   smp_processor_id());
 		/* Switch it off */
 		lapic_timer_shutdown(evt);
 		return;

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


Thread

[patch V3 09/44] x86/apic: Use this_cpu_ptr in local_timer_interrupt Thomas Gleixner <tglx@linutronix.de> - 2017-08-28 09:10 +0200
  [tip:x86/apic] x86/apic: Use this_cpu_ptr() in  local_timer_interrupt() tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-08-29 13:20 +0200

csiph-web