From 59a48cb8e6d41e36dfea100541ac92160ffb80d7 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Tue, 18 May 2010 11:12:48 +0200 Subject: [PATCH] --- yaml --- r: 199096 b: refs/heads/master c: 6d1acfd5c6bfd5231c13a8f2858d7f2afbaa1b62 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/perf_event.h | 1 + trunk/kernel/perf_event.c | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index dda99bb363a0..19a80c26da83 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fa5881514ef9c9bcb29319aad85cf2d8889d91f1 +refs/heads/master: 6d1acfd5c6bfd5231c13a8f2858d7f2afbaa1b62 diff --git a/trunk/include/linux/perf_event.h b/trunk/include/linux/perf_event.h index ce7667616fcb..fe50347dc645 100644 --- a/trunk/include/linux/perf_event.h +++ b/trunk/include/linux/perf_event.h @@ -804,6 +804,7 @@ struct perf_output_handle { struct perf_mmap_data *data; unsigned long head; unsigned long offset; + unsigned long wakeup; int nmi; int sample; }; diff --git a/trunk/kernel/perf_event.c b/trunk/kernel/perf_event.c index 1f98c78c3343..7e3bcf1a29f0 100644 --- a/trunk/kernel/perf_event.c +++ b/trunk/kernel/perf_event.c @@ -2917,6 +2917,7 @@ static void perf_output_get_handle(struct perf_output_handle *handle) preempt_disable(); local_inc(&data->nest); + handle->wakeup = local_read(&data->wakeup); } static void perf_output_put_handle(struct perf_output_handle *handle) @@ -2950,7 +2951,7 @@ static void perf_output_put_handle(struct perf_output_handle *handle) goto again; } - if (local_xchg(&data->wakeup, 0)) + if (handle->wakeup != local_read(&data->wakeup)) perf_output_wakeup(handle); preempt_enable();