|
@@ -4079,8 +4079,7 @@ static void cpu_clock_perf_event_update(struct perf_event *event)
|
|
u64 now;
|
|
u64 now;
|
|
|
|
|
|
now = cpu_clock(cpu);
|
|
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);
|
|
atomic64_add(now - prev, &event->count);
|
|
}
|
|
}
|
|
|
|
|