Am 03.07.2014 09:32, schrieb Tom Hughes:
> On 03/07/14 07:06, Jerry Scharf wrote:
> 
>> Why is it insisting that the numbers be powers of 2? If I use --LL with the 
>> real numbers it refuses to start. If I round these down to the next lower 
>> power of 2 (16M and 16 associations) it doesn't complain but it still 
>> doesn't run.

What's the output of "it still doesn't run"?

> The internal design of the data structures used by cachegrind assumes 
> that sizes will be powers of two and that it can compute indexes by bit 
> masking.

The cache size does not have to be a power of two, only the number of
sets has to,
to do the bit masking trick. E.g. 25MB with assoc 25, e.g.
"--LL=26214400,25,64"
works here. It probably does not make much difference between assoc of
20 or 25.

Of course we could use modulo instead of the bit mask trick, but this
gives around
a factor of 2 slowdown, also for the original fast power-of-two cases.

BTW, if you have a test system anyway, real performance measurements
should be
more important to you. Cachegrind mainly helps finding the code to
optimize for
reducing cache misses, and makes comparisons easier due to reproducability.

> That is, as you have found, no longer true for modern processors, but to 
> date nobody has stepped up to fix cachegrind.

The best way to fix this may just be to always find a good approximation of
parameters (keeping cache size is more important), which make the number
of sets a
power of two, and run simulation with these. Cachegrind results are an
approximation
anyway (no hardware prefetcher simulation, LRU may not be really correct).

Josef


> On top of that it isn't
> clear that there is a good fix that wouldn't produce a loss of performance.
> 
> Tom
> 

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to