Re: [PATCH] POWER: perf_event: Skip updating kernel counters if register value shrinks

2011-04-07 Thread Eric B Munson
On Thu, 07 Apr 2011, Benjamin Herrenschmidt wrote: > > > > Doesn't that mean that power_pmu_read() can only ever increase the value > > > of > > > the perf_event and so will essentially -stop- once the counter rolls over > > > ? > > > > > > Similar comments every where you do this type of comp

Re: [PATCH] POWER: perf_event: Skip updating kernel counters if register value shrinks

2011-04-06 Thread Benjamin Herrenschmidt
> > Doesn't that mean that power_pmu_read() can only ever increase the value of > > the perf_event and so will essentially -stop- once the counter rolls over ? > > > > Similar comments every where you do this type of comparison. > > > > Cheers, > > Ben. > > Sorry for the nag, but am I missing s

Re: [PATCH] POWER: perf_event: Skip updating kernel counters if register value shrinks

2011-04-06 Thread Eric B Munson
On Thu, 31 Mar 2011, Benjamin Herrenschmidt wrote: > On Wed, 2011-03-30 at 14:36 -0400, Eric B Munson wrote: > > On Wed, 30 Mar 2011, Benjamin Herrenschmidt wrote: > > > > > On Tue, 2011-03-29 at 10:25 -0400, Eric B Munson wrote: > > > > Here I made the assumption that the hardware would never re

Re: [PATCH] POWER: perf_event: Skip updating kernel counters if register value shrinks

2011-03-31 Thread Eric B Munson
On Thu, 31 Mar 2011, Benjamin Herrenschmidt wrote: > On Wed, 2011-03-30 at 14:36 -0400, Eric B Munson wrote: > > On Wed, 30 Mar 2011, Benjamin Herrenschmidt wrote: > > > > > On Tue, 2011-03-29 at 10:25 -0400, Eric B Munson wrote: > > > > Here I made the assumption that the hardware would never re

Re: [PATCH] POWER: perf_event: Skip updating kernel counters if register value shrinks

2011-03-30 Thread Benjamin Herrenschmidt
On Wed, 2011-03-30 at 14:36 -0400, Eric B Munson wrote: > On Wed, 30 Mar 2011, Benjamin Herrenschmidt wrote: > > > On Tue, 2011-03-29 at 10:25 -0400, Eric B Munson wrote: > > > Here I made the assumption that the hardware would never remove more > > > events in > > > a speculative roll back than

Re: [PATCH] POWER: perf_event: Skip updating kernel counters if register value shrinks

2011-03-30 Thread Eric B Munson
On Wed, 30 Mar 2011, Benjamin Herrenschmidt wrote: > On Tue, 2011-03-29 at 10:25 -0400, Eric B Munson wrote: > > Here I made the assumption that the hardware would never remove more events > > in > > a speculative roll back than it had added. This is not a situation I > > encoutered in my limite

Re: [PATCH] POWER: perf_event: Skip updating kernel counters if register value shrinks

2011-03-29 Thread Benjamin Herrenschmidt
On Tue, 2011-03-29 at 10:25 -0400, Eric B Munson wrote: > Here I made the assumption that the hardware would never remove more events in > a speculative roll back than it had added. This is not a situation I > encoutered in my limited testing, so I didn't think underflow was possible. I > will se

Re: [PATCH] POWER: perf_event: Skip updating kernel counters if register value shrinks

2011-03-29 Thread Eric B Munson
On Tue, 29 Mar 2011, Benjamin Herrenschmidt wrote: > On Fri, 2011-03-25 at 09:28 -0400, Eric B Munson wrote: > > It is possible on POWER7 for some perf events to have values decrease. This > > causes a problem with the way the kernel counters are updated. Deltas are > > computed and then stored

Re: [PATCH] POWER: perf_event: Skip updating kernel counters if register value shrinks

2011-03-28 Thread Benjamin Herrenschmidt
On Fri, 2011-03-25 at 09:28 -0400, Eric B Munson wrote: > It is possible on POWER7 for some perf events to have values decrease. This > causes a problem with the way the kernel counters are updated. Deltas are > computed and then stored in a 64 bit value while the registers are 32 bits > wide so

[PATCH] POWER: perf_event: Skip updating kernel counters if register value shrinks

2011-03-25 Thread Eric B Munson
It is possible on POWER7 for some perf events to have values decrease. This causes a problem with the way the kernel counters are updated. Deltas are computed and then stored in a 64 bit value while the registers are 32 bits wide so if new value is smaller than previous value, the delta is a very