lkml.org 
[lkml]   [2011]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V4] POWER: perf_event: Skip updating kernel counters if register value shrinks
On Wed, 27 Apr 2011, David Laight wrote:

>
> > + if (prev > val && (prev - val) < 256)
> > + delta = 0;
> > +
> > + return delta;
>
> Also, 'prev' is a true 64bit value, but 'val' is only ever 32bits.
> So once the 64bit 'prev' exceeds 2^32+256 both 'prev > val'
> and 'prev - val' are true regardless of the value of 'val'.
> This will lead to jumps in the value ....

prev and val are both 64 bit variables holding 32 bit numbers, we do not
accumulate in either, they are both replaced by values directly from the
registers. So prev > val will not always be true.

Eric
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2011-04-27 15:11    [W:0.316 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site