Skip to content

Commit

Permalink
perf_event: Cleanup for cpu_clock_perf_event_update()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xiao Guangrong authored and Ingo Molnar committed Dec 9, 2009
1 parent b93f797 commit ec89a06
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -4079,8 +4079,7 @@ static void cpu_clock_perf_event_update(struct perf_event *event)
u64 now;

now = cpu_clock(cpu);
prev = atomic64_read(&event->hw.prev_count);
atomic64_set(&event->hw.prev_count, now);
prev = atomic64_xchg(&event->hw.prev_count, now);
atomic64_add(now - prev, &event->count);
}

Expand Down

0 comments on commit ec89a06

Please sign in to comment.