From: "Yan, Zheng" <zheng.z.yan@intel.com>
To: Stephane Eranian <eranian@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Robert Richter <robert.richter@amd.com>,
mingo@elte.hu
Subject: Re: [BUG] perf: sharing of cpuctx between core and ibs PMU causes problems
Date: Thu, 09 Aug 2012 14:55:12 +0800 [thread overview]
Message-ID: <50235ED0.5010107@intel.com> (raw)
In-Reply-To: <CABPqkBRWLcP_9WOL_VvucnY7A2AcpzuvsUt4_ZUgYMREo-65dA@mail.gmail.com>
On 08/09/2012 08:51 AM, Stephane Eranian wrote:
> Hi,
>
> I ran into a problem on my AMD box whereby I would hit the
> WARN_ON_ONCE(cpuctx->cgrp) in perf_cgroup_switch().
>
> It took me a while to track this down. It turns out that the
> list_for_each_entry_rcu() loop had multiple iterations. That's
> normal, we have CPU PMU and IBS PMU. But what caused
> the warning to fire is that both the core and IBS PMU were
> pointing to the same cpuctx struct. Thus, the cpuctx->cgrp
> was already set in the second iteration.
>
> Is the warning a false positive?
I think it's a false positive, I'm not sure.
>
> In perf_pmu_register(), there is a search for a matching
> pmu->task_ctx_nr. Given that the field is pointing to
> perf_hw_context for both cpu and IBS PMU, there is
> a match and therefore the cpuctx are shared.
>
> The question is: why do we have to share the cpuctx?
>
> Note that the same issue probably exists with the Intel
> uncore PMU.
uncore PMU does not have this issue because uncore_pmu->task_ctx_nr
is 'perf_invalid_context'. find_pmu_context() always return NULL in
that case.
Regards
Yan, Zheng.
>
> If we need to share, then the perf_cgroup_switch() code
> needs to change because, as it stands, it is doing the
> switching twice in this case.
>
> Either way something looks wrong here.
>
> Any idea?
>
next prev parent reply other threads:[~2012-08-09 6:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-09 0:51 [BUG] perf: sharing of cpuctx between core and ibs PMU causes problems Stephane Eranian
2012-08-09 6:55 ` Yan, Zheng [this message]
2012-08-09 14:05 ` Stephane Eranian
2012-08-09 18:08 ` Peter Zijlstra
2012-08-09 19:21 ` Stephane Eranian
2012-08-13 10:28 ` Peter Zijlstra
2012-08-13 12:53 ` Stephane Eranian
2012-08-13 15:32 ` Peter Zijlstra
2012-08-13 15:36 ` Stephane Eranian
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=50235ED0.5010107@intel.com \
--to=zheng.z.yan@intel.com \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.