From: Eric B Munson Date: Fri, 15 Apr 2011 08:12:30 +0000 (+0000) Subject: powerpc/perf_event: Skip updating kernel counters if register value shrinks X-Git-Tag: v2.6.39-rc4~4^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86c74ab317c1ef4d37325e0d7ca8a01a796b0bd7;p=pandora-kernel.git powerpc/perf_event: Skip updating kernel counters if register value shrinks 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: Eric B Munson Cc: stable@kernel.org Signed-off-by: Benjamin Herrenschmidt --- Reading git-diff-tree failed