diff options
author | Peter Zijlstra <peterz@infradead.org> | 2013-10-28 08:55:29 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-10-29 07:01:19 -0400 |
commit | bf378d341e4873ed928dc3c636252e6895a21f50 (patch) | |
tree | df69751e469725f2e23da8404884b5540d1bcddc /include | |
parent | cd65718712469ad844467250e8fad20a5838baae (diff) |
perf: Fix perf ring buffer memory ordering
The PPC64 people noticed a missing memory barrier and crufty old
comments in the perf ring buffer code. So update all the comments and
add the missing barrier.
When the architecture implements local_t using atomic_long_t there
will be double barriers issued; but short of introducing more
conditional barrier primitives this is the best we can do.
Reported-by: Victor Kaplansky <victork@il.ibm.com>
Tested-by: Victor Kaplansky <victork@il.ibm.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: michael@ellerman.id.au
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Michael Neuling <mikey@neuling.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: anton@samba.org
Cc: benh@kernel.crashing.org
Link: http://lkml.kernel.org/r/20131025173749.GG19466@laptop.lan
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/uapi/linux/perf_event.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index 009a655a5d35..2fc1602e23bb 100644 --- a/include/uapi/linux/perf_event.h +++ b/include/uapi/linux/perf_event.h | |||
@@ -456,13 +456,15 @@ struct perf_event_mmap_page { | |||
456 | /* | 456 | /* |
457 | * Control data for the mmap() data buffer. | 457 | * Control data for the mmap() data buffer. |
458 | * | 458 | * |
459 | * User-space reading the @data_head value should issue an rmb(), on | 459 | * User-space reading the @data_head value should issue an smp_rmb(), |
460 | * SMP capable platforms, after reading this value -- see | 460 | * after reading this value. |
461 | * perf_event_wakeup(). | ||
462 | * | 461 | * |
463 | * When the mapping is PROT_WRITE the @data_tail value should be | 462 | * When the mapping is PROT_WRITE the @data_tail value should be |
464 | * written by userspace to reflect the last read data. In this case | 463 | * written by userspace to reflect the last read data, after issueing |
465 | * the kernel will not over-write unread data. | 464 | * an smp_mb() to separate the data read from the ->data_tail store. |
465 | * In this case the kernel will not over-write unread data. | ||
466 | * | ||
467 | * See perf_output_put_handle() for the data ordering. | ||
466 | */ | 468 | */ |
467 | __u64 data_head; /* head in the data section */ | 469 | __u64 data_head; /* head in the data section */ |
468 | __u64 data_tail; /* user-space written tail */ | 470 | __u64 data_tail; /* user-space written tail */ |