From 230a3c31ccdb5b16f8a08502ebb61d4207da460f Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Mon, 6 Apr 2009 11:44:59 +0200 Subject: [PATCH] --- yaml --- r: 147323 b: refs/heads/master c: a2e87d06ddbe6e6fdb8d6d2e5e985efe4efb07dd h: refs/heads/master i: 147321: 07a31f67fa7829ca15ceff611ae88bd9b85f8dc1 147319: f08e71827fc794be8adae71560e446c11b525518 v: v3 --- [refs] | 2 +- trunk/include/linux/perf_counter.h | 24 ++++++++++-------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/[refs] b/[refs] index 6f812f546a6d..c796cab4aa44 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 92f22a3865abe87eea2609a6f8e5be5123f7ce4f +refs/heads/master: a2e87d06ddbe6e6fdb8d6d2e5e985efe4efb07dd diff --git a/trunk/include/linux/perf_counter.h b/trunk/include/linux/perf_counter.h index f2b914de3f0c..e22ab47a2f41 100644 --- a/trunk/include/linux/perf_counter.h +++ b/trunk/include/linux/perf_counter.h @@ -170,22 +170,18 @@ struct perf_counter_mmap_page { * u32 seq; * s64 count; * - * again: - * seq = pc->lock; - * if (unlikely(seq & 1)) { - * cpu_relax(); - * goto again; - * } + * do { + * seq = pc->lock; * - * if (pc->index) { - * count = pmc_read(pc->index - 1); - * count += pc->offset; - * } else - * goto regular_read; + * barrier() + * if (pc->index) { + * count = pmc_read(pc->index - 1); + * count += pc->offset; + * } else + * goto regular_read; * - * barrier(); - * if (pc->lock != seq) - * goto again; + * barrier(); + * } while (pc->lock != seq); * * NOTE: for obvious reason this only works on self-monitoring * processes.