diff options
author | Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> | 2009-12-08 22:30:36 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-09 03:56:27 -0500 |
commit | ec89a06fd4e12301f11ab039ee07d2353a18addc (patch) | |
tree | 507d33bda6504dd8422b9952156d338b0200fb2b | |
parent | b93f7978ad6b46133e9453b90ccc057dc2429e75 (diff) |
perf_event: Cleanup for cpu_clock_perf_event_update()
Using atomic64_xchg() instead of atomic64_read() and
atomic64_set().
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Reviewed-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <4B1F19DC.90204@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | kernel/perf_event.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 77641ae6b23f..94e1b28333ae 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
@@ -4079,8 +4079,7 @@ static void cpu_clock_perf_event_update(struct perf_event *event) | |||
4079 | u64 now; | 4079 | u64 now; |
4080 | 4080 | ||
4081 | now = cpu_clock(cpu); | 4081 | now = cpu_clock(cpu); |
4082 | prev = atomic64_read(&event->hw.prev_count); | 4082 | prev = atomic64_xchg(&event->hw.prev_count, now); |
4083 | atomic64_set(&event->hw.prev_count, now); | ||
4084 | atomic64_add(now - prev, &event->count); | 4083 | atomic64_add(now - prev, &event->count); |
4085 | } | 4084 | } |
4086 | 4085 | ||