From: Don Zickus <dzickus@redhat.com>
To: Vince Weaver <vweaver1@eecs.utk.edu>
Cc: Peter Zijlstra <peterz@infradead.org>,
Mike Hommey <mh@glandium.org>,
linux-kernel@vger.kernel.org
Subject: Re: Problem with perf hardware counters grouping
Date: Tue, 6 Sep 2011 16:22:32 -0400 [thread overview]
Message-ID: <20110906202232.GS5795@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1109061538270.24588@cl320.eecs.utk.edu>
On Tue, Sep 06, 2011 at 03:43:09PM -0400, Vince Weaver wrote:
> On Thu, 1 Sep 2011, Peter Zijlstra wrote:
> >
> > Both those have 4 generic hardware counters, but x86 defaults to
> > enabling the NMI watchdog which takes one, leaving you with 3 (try: echo
> > 0 > /proc/sys/kernel/nmi_watchdog). If you had looked at your dmesg
> > output you'd have found lines like:
> >
> > NMI watchdog enabled, takes one hw-pmu counter.
> >
> > The code can only check if the group as a whole could possibly fit on a
> > PMU, which is where your failure on >4 comes from.
> >
> > What happens with your >3 case is that while the group is valid and
> > could fit on the PMU, it won't fit at runtime because the NMI watchdog
> > is taking one and won't budge (cpu-pinned counter have precedence over
> > any other kind), effectively starving your group of pmu runtime.
> >
> > Also, we should fix that return to say -EINVAL or so.
>
> So any hope of a fix on this?
>
> As mentioned this is a serious problem for PAPI and I am trying to find a
> good way to enable a workaround in a way that doesn't punish people who
> have the watchdog disabled.
>
> Is there a "stable" API method of determining if the nmi_watchdog is
> present and stealing a perf-counter?
>
> If I find a "1" in /proc/sys/kernel/nmi_watchdog can I assume a counter is
> being stolen?
Short answer: yes
Long answer: all that means is the nmi_watchdog is running on some
counter, hopefully the hardware based performance counters. In some rare
cases where the hardware isn't available it may fallback to software based
counters. But if the hardware isn't available, I think PAPI will have
bigger issues than the nmi_watchdog. :-)
Cheers,
Don
prev parent reply other threads:[~2011-09-06 20:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-31 8:57 Problem with perf hardware counters grouping Mike Hommey
2011-09-01 11:53 ` Peter Zijlstra
2011-09-01 11:59 ` Mike Hommey
2011-09-01 12:40 ` Peter Zijlstra
2011-09-01 15:21 ` Vince Weaver
2011-09-01 16:41 ` Peter Zijlstra
2011-09-01 17:16 ` Vince Weaver
2011-09-01 17:24 ` Vince Weaver
2011-09-06 19:43 ` Vince Weaver
2011-09-06 20:22 ` Don Zickus [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=20110906202232.GS5795@redhat.com \
--to=dzickus@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mh@glandium.org \
--cc=peterz@infradead.org \
--cc=vweaver1@eecs.utk.edu \
/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.