summaryrefslogtreecommitdiffstats
path: root/kernel/events/ring_buffer.c
diff options
context:
space:
mode:
authorPaul E. McKenney2015-04-25 21:48:29 +0200
committerPaul E. McKenney2015-05-27 21:58:02 +0200
commit5af4692a75daf08dddc93dbb4cd2a1b3d3b617af (patch)
treecd86327aa73bd38e2adbd546c0eeb3c512da1f5d /kernel/events/ring_buffer.c
parentrcu: Add more debug info on "kthread starved" RCU CPU stall warnings (diff)
downloadkernel-qcow2-linux-5af4692a75daf08dddc93dbb4cd2a1b3d3b617af.tar.gz
kernel-qcow2-linux-5af4692a75daf08dddc93dbb4cd2a1b3d3b617af.tar.xz
kernel-qcow2-linux-5af4692a75daf08dddc93dbb4cd2a1b3d3b617af.zip
smp: Make control dependencies work on Alpha, improve documentation
The current formulation of control dependencies fails on DEC Alpha, which does not respect dependencies of any kind unless an explicit memory barrier is provided. This means that the current fomulation of control dependencies fails on Alpha. This commit therefore creates a READ_ONCE_CTRL() that has the same overhead on non-Alpha systems, but causes Alpha to produce the needed ordering. This commit also applies READ_ONCE_CTRL() to the one known use of control dependencies. Use of READ_ONCE_CTRL() also has the beneficial effect of adding a bit of self-documentation to control dependencies. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Diffstat (limited to 'kernel/events/ring_buffer.c')
-rw-r--r--kernel/events/ring_buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
index 232f00f273cb..17fcb73c4a50 100644
--- a/kernel/events/ring_buffer.c
+++ b/kernel/events/ring_buffer.c
@@ -141,7 +141,7 @@ int perf_output_begin(struct perf_output_handle *handle,
perf_output_get_handle(handle);
do {
- tail = ACCESS_ONCE(rb->user_page->data_tail);
+ tail = READ_ONCE_CTRL(rb->user_page->data_tail);
offset = head = local_read(&rb->head);
if (!rb->overwrite &&
unlikely(CIRC_SPACE(head, tail, perf_data_size(rb)) < size))