aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-05-20 10:21:55 -0400
committerIngo Molnar <mingo@elte.hu>2010-05-21 05:37:58 -0400
commitadb8e118f288dc4c569ac9a89010b81a4745fbf0 (patch)
tree40f2bbbe7c59fb4b4a44120fa9cc79822b68e545 /kernel
parent0e2e63dd608bf5844ffae7bf7d860de18a62724c (diff)
perf: Fix wakeup storm for RO mmap()s
RO mmap()s don't update the tail pointer, so comparing against it for determining the written data size doesn't really do any good. Keep track of when we last did a wakeup, and compare against that. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Steven Rostedt <rostedt@goodmis.org> LKML-Reference: <20100521090710.684479310@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/perf_event.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 7a932526946f..1531e0b409a5 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -3056,8 +3056,8 @@ int perf_output_begin(struct perf_output_handle *handle,
3056 handle->offset = offset; 3056 handle->offset = offset;
3057 handle->head = head; 3057 handle->head = head;
3058 3058
3059 if (head - tail > data->watermark) 3059 if (head - local_read(&data->wakeup) > data->watermark)
3060 local_inc(&data->wakeup); 3060 local_add(data->watermark, &data->wakeup);
3061 3061
3062 if (have_lost) { 3062 if (have_lost) {
3063 lost_event.header.type = PERF_RECORD_LOST; 3063 lost_event.header.type = PERF_RECORD_LOST;