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

From: David Laight
Date: Wed Apr 27 2011 - 08:43:24 EST



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

David


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/