Commit acd35a46 authored by Frederic Weisbecker's avatar Frederic Weisbecker
Browse files

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: default avatarFrederic Weisbecker <>
Cc: Ingo Molnar <>
Cc: Peter Zijlstra <>
Cc: Arnaldo Carvalho de Melo <>
Cc: Paul Mackerras <>
Cc: Stephane Eranian <>
Cc: Robert Richter <>
parent dfacc4d6
......@@ -2933,7 +2933,7 @@ static void perf_output_put_handle(struct perf_output_handle *handle)
if (!local_dec_and_test(&data->nest))
goto out;
* Publish the known good head. Rely on the full barrier implied
......@@ -2954,6 +2954,7 @@ static void perf_output_put_handle(struct perf_output_handle *handle)
if (handle->wakeup != local_read(&data->wakeup))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment