summaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2013-10-30 06:42:46 -0400
committerIngo Molnar <mingo@kernel.org>2013-11-06 06:34:26 -0500
commita94d342b9cb09edfe888ea972af0883b6a8d992b (patch)
treedd3af73c84e210548c79d32dafbe4fadb2a42eb9 /tools/perf/util
parent0a196848ca365ec582c6d86659be456be6d4ed96 (diff)
tools/perf: Add required memory barriers
To match patch bf378d341e48 ("perf: Fix perf ring buffer memory ordering") change userspace to also adhere to the ordering outlined. Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Michael Neuling <mikey@neuling.org> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Cc: james.hogan@imgtec.com Cc: Vince Weaver <vince@deater.net> Cc: Victor Kaplansky <VICTORK@il.ibm.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Anton Blanchard <anton@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Cc: Michael Ellerman <michael@ellerman.id.au> Link: http://lkml.kernel.org/r/20131030104246.GH16117@laptop.programming.kicks-ass.net Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/evlist.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index e99eaed92682..ecaa582f40e2 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -177,7 +177,7 @@ int perf_evlist__strerror_open(struct perf_evlist *evlist, int err, char *buf, s
177static inline unsigned int perf_mmap__read_head(struct perf_mmap *mm) 177static inline unsigned int perf_mmap__read_head(struct perf_mmap *mm)
178{ 178{
179 struct perf_event_mmap_page *pc = mm->base; 179 struct perf_event_mmap_page *pc = mm->base;
180 int head = pc->data_head; 180 int head = ACCESS_ONCE(pc->data_head);
181 rmb(); 181 rmb();
182 return head; 182 return head;
183} 183}
@@ -190,7 +190,7 @@ static inline void perf_mmap__write_tail(struct perf_mmap *md,
190 /* 190 /*
191 * ensure all reads are done before we write the tail out. 191 * ensure all reads are done before we write the tail out.
192 */ 192 */
193 /* mb(); */ 193 mb();
194 pc->data_tail = tail; 194 pc->data_tail = tail;
195} 195}
196 196