[tip:perfcounters/core] perf_counter: kerneltop: simplify data_head read

From: Peter Zijlstra
Date: Wed Apr 01 2009 - 06:14:58 EST


Commit-ID: b5b7e234c3d14eb614998ce5a96719baf146c71c
Gitweb: http://git.kernel.org/tip/b5b7e234c3d14eb614998ce5a96719baf146c71c
Author: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
AuthorDate: Mon, 30 Mar 2009 19:07:04 +0200
Committer: Ingo Molnar <mingo@xxxxxxx>
CommitDate: Wed, 1 Apr 2009 11:33:33 +0200

perf_counter: kerneltop: simplify data_head read

Now that the kernel side changed, match up again.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Acked-by: Paul Mackerras <paulus@xxxxxxxxx>
LKML-Reference: <20090330171023.327144324@xxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>


---
Documentation/perf_counter/kerneltop.c | 14 +-------------
1 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/Documentation/perf_counter/kerneltop.c b/Documentation/perf_counter/kerneltop.c
index fda1438..2779c57 100644
--- a/Documentation/perf_counter/kerneltop.c
+++ b/Documentation/perf_counter/kerneltop.c
@@ -1125,22 +1125,10 @@ struct mmap_data {
static unsigned int mmap_read_head(struct mmap_data *md)
{
struct perf_counter_mmap_page *pc = md->base;
- unsigned int seq, head;
-
-repeat:
- rmb();
- seq = pc->lock;
-
- if (unlikely(seq & 1)) {
- cpu_relax();
- goto repeat;
- }
+ int head;

head = pc->data_head;
-
rmb();
- if (pc->lock != seq)
- goto repeat;

return head;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/