From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Anton Blanchard <anton@au1.ibm.com>, paulus@samba.org
Subject: POWER7: Question on speculative rollback
Date: Sat, 22 Sep 2012 15:41:47 -0700 [thread overview]
Message-ID: <20120922224147.GA4946@us.ibm.com> (raw)
Is there a way to reliably check if a speculative roll back has occured in
the CPU ?
Normally we consider that an overflow has occured if the number of events
in a PMC reaches the overflow mark (0x80000000).
With speculative rollback, we assume that the overflow has occured if the
number of events is short of the overflow mark by 256 or less. pmc_overflow()
and check_compute_delta() use this assumption.
The problem with this assumption is that it is not always valid which is
why perf_event_interrupt() uses two different checks for overflow.
In the first pass it uses '(int)val < 0' and in the second pass the
pmc_overflow() helper.
The reason for falling back to 'val < 0' check is that the sampling period
could be very low and the number of events could truly be less than 256
even if no speculative roll back had occured.
But the problem with the 'val < 0' check is that if speculative rollback did
occur, we would not detect the rollback. We simply go ahead and reset the
counters and THROW AWAY all the events that occured until that point.
Over time and possibly with larger sampling periods, the number of events
thrown away can lead to very inaccurate results.
So, is there a better way to detect if a speculative rollback has occured
when we get a perf_event_interrupt() ?
Sukadev
reply other threads:[~2012-09-22 22:41 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=20120922224147.GA4946@us.ibm.com \
--to=sukadev@linux.vnet.ibm.com \
--cc=anton@au1.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--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;
as well as URLs for NNTP newsgroup(s).