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


Groups > linux.kernel > #1721104 > unrolled thread

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

Started byThomas Gleixner <tglx@linutronix.de>
First post2017-08-28 09:10 +0200
Last post2017-08-29 13:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [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

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

FromThomas Gleixner <tglx@linutronix.de>
Date2017-08-28 09:10 +0200
Subject[patch V3 09/44] x86/apic: Use this_cpu_ptr in local_timer_interrupt
Message-ID<ujmll-2xk-25@gated-at.bofh.it>
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;

[toc] | [next] | [standalone]


#1722337 — [tip:x86/apic] x86/apic: Use this_cpu_ptr() in local_timer_interrupt()

Fromtip-bot for Thomas Gleixner <tipbot@zytor.com>
Date2017-08-29 13:20 +0200
Subject[tip:x86/apic] x86/apic: Use this_cpu_ptr() in local_timer_interrupt()
Message-ID<ujMIP-1VL-27@gated-at.bofh.it>
In reply to#1721104
Commit-ID:  3bec6def39e32609e01a68b43476ee1f1c512eaa
Gitweb:     http://git.kernel.org/tip/3bec6def39e32609e01a68b43476ee1f1c512eaa
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Mon, 28 Aug 2017 08:47:24 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 29 Aug 2017 11:42:24 +0200

x86/apic: Use this_cpu_ptr() in local_timer_interrupt()

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>
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>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20170828064956.829552757@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/apic/apic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 7a57b54..a33fa44 100644
--- 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(void)
 	 * 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;

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web