Messages in this thread | | | Date | Mon, 28 Oct 2013 13:17:47 +0100 | From | Peter Zijlstra <> | Subject | Re: [PATCH v3 3/4] perf,x86: add Intel RAPL PMU support |
| |
On Mon, Oct 28, 2013 at 11:33:50AM +0100, Stephane Eranian wrote: > If we have that, then it may not be necessary anymore > to express the raw count in the 1/2^32 J unit like we > are currently doing. This loses a bit of precision. We > could as well expose the actual raw count and export > the actual unit via sysfs. For instance, on SNB/IVB the > unit is 1/2^16, but on Haswell it is 1/2^14.
2^-32 can losslessly express both 2^-16 and 2^-14.
Notably: 2^18/2^32 = 2^(18-32) = 2^-14.
So no, 2^-32 does not loose precision.
The only side effect of always using 2^-32 is that we can only maximally represent 2^32 (from 64-32), whereas when using 2^-14 we could maximally represent 2^50.
That said; 2^32 Joule ~ 4.2 GJ which is a rather large quantity of energy; one I would hope is out there when measuring package energy costs over any reasonable amount of time.
So the only reason to switch away from using the 32.32 fixed point would be if someone can make a reasonable argument for why 4.2 GJ is not sufficient and they need 1 PJ (yes, peta-joule, as in we need a private nuclear reactor to power this CPU).
| |