[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-ec89a06fd4e12301f11ab039ee07d2353a18addc@git.kernel.org>
Date: Wed, 9 Dec 2009 09:52:40 GMT
From: tip-bot for Xiao Guangrong <xiaoguangrong@...fujitsu.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, paulus@...ba.org, hpa@...or.com,
mingo@...hat.com, peterz@...radead.org,
xiaoguangrong@...fujitsu.com, fweisbec@...il.com,
tglx@...utronix.de, mingo@...e.hu
Subject: [tip:perf/urgent] perf_event: Cleanup for cpu_clock_perf_event_update()
Commit-ID: ec89a06fd4e12301f11ab039ee07d2353a18addc
Gitweb: http://git.kernel.org/tip/ec89a06fd4e12301f11ab039ee07d2353a18addc
Author: Xiao Guangrong <xiaoguangrong@...fujitsu.com>
AuthorDate: Wed, 9 Dec 2009 11:30:36 +0800
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Wed, 9 Dec 2009 09:56:27 +0100
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@...fujitsu.com>
Reviewed-by: Frederic Weisbecker <fweisbec@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Paul Mackerras <paulus@...ba.org>
LKML-Reference: <4B1F19DC.90204@...fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
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 77641ae..94e1b28 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)
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);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists