From: Eric B Munson <emunson@mgebm.net>
To: Stephane Eranian <eranian@google.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
mingo@elte.hu, anton@samba.org, linux-kernel@vger.kernel.org,
paulus@samba.org, hbabu@us.ibm.com
Subject: Re: Oprofile Regression Caused by commit e5d1367f17ba6a6fed5fd8b74e4d5720923e0c25 on PPC
Date: Tue, 18 Oct 2011 11:20:39 -0400 [thread overview]
Message-ID: <20111018152039.GB11530@mgebm.net> (raw)
In-Reply-To: <CABPqkBRxqC5c1JvvpDawkK9PizAfBGNCksR8bpyJ-rWB4LKmrQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2145 bytes --]
On Tue, 18 Oct 2011, Stephane Eranian wrote:
> Hi,
>
> I suspect it's because of this chunk:
> rcu_read_lock();
>
> list_for_each_entry_rcu(pmu, &pmus, entry) {
> -
> cpuctx = this_cpu_ptr(pmu->pmu_cpu_context);
>
> - perf_pmu_disable(cpuctx->ctx.pmu);
> -
> /*
> * perf_cgroup_events says at least one
> * context on this CPU has cgroup events.
> @@ -353,6 +366,8 @@ void perf_cgroup_switch(struct task_struct *task, int mode)
> * events for a context.
> */
> if (cpuctx->ctx.nr_cgroups > 0) {
> + perf_ctx_lock(cpuctx, cpuctx->task_ctx);
> + perf_pmu_disable(cpuctx->ctx.pmu);
>
>
> In other words, you don't call perf_pmu_disable() unless you know
> you have cgroup events.
>
> Without that, I think you will touch the PMU on cgroup switch and
> that night conflict with another subsystem using the PMU, e.g. OProfile.
Exactly, the inital bug was being caused by something in perf touching the MMCR0
register without reserving the hardware first (or noticing that oprofile had
already done so). So oprofile runs would show abnormally low event counts or
counts that were not there if you were really unlucky. This patch fixes the
problem because the MMCR0 register will not be touched unless there was there
were cgroup events active.
>
>
> On Tue, Oct 18, 2011 at 4:43 PM, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> > On Tue, 2011-10-18 at 09:53 -0400, Eric B Munson wrote:
> >> On Wed, 12 Oct 2011, Stephane Eranian wrote:
> >>
> >> > Could be:
> >> > a8d757e perf events: Fix slow and broken cgroup context switch code
> >> >
> >>
> >> Thanks for the pointer, but the fix was in:
> >> facc4307 perf: Optimize event scheduling locking
> >>
> >> This might be a candidate for stable given that oprofile is broken without it.
> >
> > I might feel much more confident about recommending that if someone
> > could explain why that patches fixes what exact problem.
> >
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2011-10-18 15:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-07 20:42 Oprofile Regression Caused by commit e5d1367f17ba6a6fed5fd8b74e4d5720923e0c25 on PPC Eric B Munson
2011-10-10 23:38 ` Eric B Munson
2011-10-11 7:44 ` Peter Zijlstra
2011-10-11 7:47 ` Stephane Eranian
2011-10-11 13:34 ` Eric B Munson
2011-10-11 13:35 ` Stephane Eranian
2011-10-11 13:32 ` Eric B Munson
2011-10-12 16:51 ` Eric B Munson
2011-10-12 20:37 ` Stephane Eranian
2011-10-12 22:20 ` Eric B Munson
2011-10-18 13:53 ` Eric B Munson
2011-10-18 14:43 ` Peter Zijlstra
2011-10-18 14:50 ` Stephane Eranian
2011-10-18 15:20 ` Eric B Munson [this message]
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=20111018152039.GB11530@mgebm.net \
--to=emunson@mgebm.net \
--cc=a.p.zijlstra@chello.nl \
--cc=anton@samba.org \
--cc=eranian@google.com \
--cc=hbabu@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
/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