aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2010-05-20 15:28:34 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2010-05-20 15:28:34 -0400
commitacd35a463cb2a8d2b28e094d718cf6e653ad7191 (patch)
tree65f9392ef5b670eafa819138602a8c49458040ab /kernel
parentdfacc4d6c98b89609250269f518c1f54c30454ef (diff)
perf: Fix forgotten preempt_enable by nested writers
A writer that gets a reference to the buffer handle disables preemption. When we put that reference, we check if we are the outer most writer and if not, we simply return and defer the head update to the outer most writer. The problem here is that preemption is only reenabled by the outer most, that produces preemption count imbalance for every nested writer that exit. So just don't forget to always re-enable preemption when we put the buffer reference, whoever we are. Fixes lots of sleeping in atomic warnings, visible with lock events recording. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Stephane Eranian <eranian@google.com> Cc: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/perf_event.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 2a060be3b07f..45b7aec55458 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -2933,7 +2933,7 @@ again:
2933 */ 2933 */
2934 2934
2935 if (!local_dec_and_test(&data->nest)) 2935 if (!local_dec_and_test(&data->nest))
2936 return; 2936 goto out;
2937 2937
2938 /* 2938 /*
2939 * Publish the known good head. Rely on the full barrier implied 2939 * Publish the known good head. Rely on the full barrier implied
@@ -2954,6 +2954,7 @@ again:
2954 if (handle->wakeup != local_read(&data->wakeup)) 2954 if (handle->wakeup != local_read(&data->wakeup))
2955 perf_output_wakeup(handle); 2955 perf_output_wakeup(handle);
2956 2956
2957 out:
2957 preempt_enable(); 2958 preempt_enable();
2958} 2959}
2959 2960