diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2010-05-21 08:43:08 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-06-09 05:12:37 -0400 |
commit | e78505958cf123048fb48cb56b79cebb8edd15fb (patch) | |
tree | 3688d124cdc906cbe9f6587c8671ba0a14c95262 /arch/sh/kernel/perf_event.c | |
parent | a6e6dea68c18f705957573ee5596097c7e82d0e5 (diff) |
perf: Convert perf_event to local_t
Since now all modification to event->count (and ->prev_count
and ->period_left) are local to a cpu, change then to local64_t so we
avoid the LOCK'ed ops.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/sh/kernel/perf_event.c')
-rw-r--r-- | arch/sh/kernel/perf_event.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/sh/kernel/perf_event.c b/arch/sh/kernel/perf_event.c index 81b6de41ae5d..7a3dc3567258 100644 --- a/arch/sh/kernel/perf_event.c +++ b/arch/sh/kernel/perf_event.c | |||
@@ -185,10 +185,10 @@ static void sh_perf_event_update(struct perf_event *event, | |||
185 | * this is the simplest approach for maintaining consistency. | 185 | * this is the simplest approach for maintaining consistency. |
186 | */ | 186 | */ |
187 | again: | 187 | again: |
188 | prev_raw_count = atomic64_read(&hwc->prev_count); | 188 | prev_raw_count = local64_read(&hwc->prev_count); |
189 | new_raw_count = sh_pmu->read(idx); | 189 | new_raw_count = sh_pmu->read(idx); |
190 | 190 | ||
191 | if (atomic64_cmpxchg(&hwc->prev_count, prev_raw_count, | 191 | if (local64_cmpxchg(&hwc->prev_count, prev_raw_count, |
192 | new_raw_count) != prev_raw_count) | 192 | new_raw_count) != prev_raw_count) |
193 | goto again; | 193 | goto again; |
194 | 194 | ||
@@ -203,7 +203,7 @@ again: | |||
203 | delta = (new_raw_count << shift) - (prev_raw_count << shift); | 203 | delta = (new_raw_count << shift) - (prev_raw_count << shift); |
204 | delta >>= shift; | 204 | delta >>= shift; |
205 | 205 | ||
206 | atomic64_add(delta, &event->count); | 206 | local64_add(delta, &event->count); |
207 | } | 207 | } |
208 | 208 | ||
209 | static void sh_pmu_disable(struct perf_event *event) | 209 | static void sh_pmu_disable(struct perf_event *event) |