linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* POWER7: Question on speculative rollback
@ 2012-09-22 22:41 Sukadev Bhattiprolu
  0 siblings, 0 replies; only message in thread
From: Sukadev Bhattiprolu @ 2012-09-22 22:41 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Anton Blanchard, paulus


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-09-22 22:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-22 22:41 POWER7: Question on speculative rollback Sukadev Bhattiprolu

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).