From: Peter Zijlstra Date: Mon, 30 Mar 2009 17:07:04 +0000 (+0200) Subject: perf_counter: kerneltop: simplify data_head read X-Git-Tag: v2.6.31-rc1~383^2~426 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=195564390210977954fe4ef45b39cdee34f41b59;p=karo-tx-linux.git perf_counter: kerneltop: simplify data_head read Now that the kernel side changed, match up again. Signed-off-by: Peter Zijlstra Acked-by: Paul Mackerras Orig-LKML-Reference: <20090330171023.327144324@chello.nl> Signed-off-by: Ingo Molnar --- diff --git a/Documentation/perf_counter/kerneltop.c b/Documentation/perf_counter/kerneltop.c index fda1438365dc..2779c57ad4ba 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; }