From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: LKML <linux-kernel@vger.kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Paul Mackerras <paulus@samba.org>,
Stephane Eranian <eranian@google.com>,
Robert Richter <robert.richter@amd.com>
Subject: [GIT PULL] perf fix (preempt count imbalance on buffer)
Date: Thu, 20 May 2010 21:42:38 +0200 [thread overview]
Message-ID: <1274384558-19680-1-git-send-regression-fweisbec@gmail.com> (raw)
Ingo,
Please pull the perf/core branch that can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git
perf/core
Thanks,
Frederic
---
Frederic Weisbecker (1):
perf: Fix forgotten preempt_enable by nested writers
kernel/perf_event.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
commit acd35a463cb2a8d2b28e094d718cf6e653ad7191
Author: Frederic Weisbecker <fweisbec@gmail.com>
Date: Thu May 20 21:28:34 2010 +0200
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>
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 2a060be..45b7aec 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -2933,7 +2933,7 @@ again:
*/
if (!local_dec_and_test(&data->nest))
- return;
+ goto out;
/*
* Publish the known good head. Rely on the full barrier implied
@@ -2954,6 +2954,7 @@ again:
if (handle->wakeup != local_read(&data->wakeup))
perf_output_wakeup(handle);
+ out:
preempt_enable();
}
reply other threads:[~2010-05-20 19:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1274384558-19680-1-git-send-regression-fweisbec@gmail.com \
--to=fweisbec@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=robert.richter@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).