• Eric B Munson's avatar
    powerpc/perf_event: Skip updating kernel counters if register value shrinks · 86c74ab3
    Eric B Munson authored
    Because of speculative event roll back, it is possible for some event coutners
    to decrease between reads on POWER7.  This causes a problem with the way that
    counters are updated.  Delta calues are calculated in a 64 bit value and the
    top 32 bits are masked.  If the register value has decreased, this leaves us
    with a very large positive value added to the kernel counters.  This patch
    protects against this by skipping the update if the delta would be negative.
    This can lead to a lack of precision in the coutner values, but from my testing
    the value is typcially fewer than 10 samples at a time.
    Signed-off-by: default avatarEric B Munson <emunson@mgebm.net>
    Cc: stable@kernel.org
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    86c74ab3
perf_event.c 34.3 KB