Skip to contentSkip to conversation

perf_event: Fix preempt warning in perf_clock()

PATCH In review Peter Zijlstra 1 participant 2 messages Feb 26, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf_event: Fix preempt warning in perf_clock()

A recent commit introduced a preemption warning for perf_clock(), use raw_smp_processor_id() to avoid this, it really doesn't matter which cpu we use here.

LKML-Reference: <new-submission>
---

kernel/perf_event.c +1 -1
Index: linux-2.6/kernel/perf_event.c
===================================================================
@@ -249,7 +249,7 @@ static void perf_unpin_context(struct pe
 
 static inline u64 perf_clock(void)
 {
-	return cpu_clock(smp_processor_id());
+	return cpu_clock(raw_smp_processor_id());
 }
 
 /*
#1 lore raw
Commit-ID:  24691ea964cc0123e386b661e03a86a481c6ee79
Gitweb:     http://git.kernel.org/tip/24691ea964cc0123e386b661e03a86a481c6ee79
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Fri, 26 Feb 2010 16:36:23 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 26 Feb 2010 17:25:00 +0100

perf_event: Fix preempt warning in perf_clock()

A recent commit introduced a preemption warning for perf_clock(), use raw_smp_processor_id() to avoid this, it really doesn't matter which cpu we use here.

LKML-Reference: <1267198583.22519.684.camel@laptop>

---
 kernel/perf_event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/perf_event.c +1 -1
index 05b6c6b..aa6155b 100644
@@ -249,7 +249,7 @@ static void perf_unpin_context(struct perf_event_context *ctx)
 
 static inline u64 perf_clock(void)
 {
-	return cpu_clock(smp_processor_id());
+	return cpu_clock(raw_smp_processor_id());
 }
 
 /*