From: Vince Weaver <vincent.weaver@maine.edu>
To: "Liang, Kan" <kan.liang@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
"Odzioba, Lukasz" <lukasz.odzioba@intel.com>,
Stephane Eranian <eranian@google.com>,
"mingo@redhat.com" <mingo@redhat.com>,
LKML <linux-kernel@vger.kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
"ak@linux.intel.com" <ak@linux.intel.com>
Subject: RE: [PATCH] perf/x86: fix event counter update issue
Date: Thu, 23 Feb 2017 10:07:01 -0500 (EST) [thread overview]
Message-ID: <alpine.DEB.2.20.1702231000230.15726@macbook-air> (raw)
In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F077536A9963@SHSMSX103.ccr.corp.intel.com>
On Wed, 22 Feb 2017, Liang, Kan wrote:
> > So from what I understand, the issue is if we have an architecture with full-
> > width counters and we trigger a x86_perf_event_update() when bit
> > 47 is set?
>
> No. It related to the counter width. The number of bits we can use should be
> 1 bit less than the total width. Otherwise, there will be problem.
> For big cores such as haswell, broadwell, skylake, the counter width is 48 bit.
> So we can only use 47 bits.
> For Silvermont and KNL, the counter width is only 32 bit I think. So we can only
> use 31 bits.
So on a machine with 48-bit counters I should just have a counting event
that counts to somewhere above 0x8000 0000 0001 and it should show
problems?
Because I am unable to trigger this.
But I guess if anywhere along the line x86_perf_event_update() is run
then you start over?
I noticed your original reproducer bound the event to a core, is that
needed to trigger this?
Can it happen on a fixed event or only a genearl purpose event?
> > So if I have a test that runs in a loop for 2^48 retired instructions (which
> > takes ~12 hours on a recent machine) and then reads the results, they
> > might be wrong?
>
> It only needs several minutes to reproduce the issue on SLM/KNL.
Yes, but I only have machines with 48-bit counters. So it's going to take
256 times as long as on a machine with 40-bit counters.
I have an assembly loop that can consistently generate 2 instructions/cycle
(I'd be glad to hear suggestions for events that count faster) and on
a broadwell-ep machine it still takes at least 7 hours or so to get up
to 0x800000000000.
Vince
next prev parent reply other threads:[~2017-02-23 15:07 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-28 19:26 kan.liang
2016-11-28 19:41 ` Stephane Eranian
2016-11-28 19:59 ` Liang, Kan
2016-11-28 20:18 ` Stephane Eranian
2016-11-28 20:23 ` Liang, Kan
2016-11-29 9:25 ` Peter Zijlstra
2016-11-29 14:46 ` Liang, Kan
2016-11-29 16:58 ` Peter Zijlstra
2016-11-29 17:06 ` Liang, Kan
2016-11-29 17:17 ` Peter Zijlstra
2016-11-29 17:20 ` Stephane Eranian
2016-11-29 17:30 ` Peter Zijlstra
2016-11-29 18:11 ` Stephane Eranian
2016-11-29 18:37 ` Andi Kleen
2016-11-29 19:07 ` Liang, Kan
2016-11-29 19:32 ` Peter Zijlstra
2016-11-29 20:33 ` Liang, Kan
2016-11-29 20:37 ` Stephane Eranian
2016-12-02 12:58 ` Odzioba, Lukasz
2016-12-05 10:25 ` Peter Zijlstra
2016-12-05 11:21 ` Odzioba, Lukasz
2017-02-22 14:49 ` Vince Weaver
2017-02-22 15:28 ` Liang, Kan
2017-02-22 19:18 ` Andi Kleen
2017-02-23 15:07 ` Vince Weaver [this message]
2017-02-23 16:14 ` Liang, Kan
2016-11-29 19:08 ` Odzioba, Lukasz
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=alpine.DEB.2.20.1702231000230.15726@macbook-air \
--to=vincent.weaver@maine.edu \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=eranian@google.com \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukasz.odzioba@intel.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.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
all inboxes | Powered by JetHome®