Re: [hatari-devel] Issues with cache hits/misses?

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]




Yes, you're right - in terms of hits it will be double. I was
thinking/talking in terms of misses, which is the other way around :-)
It shouldn't 'miss' on the same longword in succession due to misaligned
access, since the first miss will serve as a hit for the second...

We agree :) but this is only true if burst mode is used, else each misaligned long read will only fill cache with 1 word of the next long read, so in the end you also get 13*2 misses.



The cache only allocates longs, even if words or misaligned longs are requested. It will pull the entire aligned long - and serves as a partial hit for the next if it overlaps. So for sequential sequences of reads, however misaligned they are, you won't encounter double the miss rate.

Assuming of course that by a 'miss' we also imply that the miss will also be fetched and placed in the cache - the normal behaviour (there are modes where allocation can be turned off, in which case misses would probably then double).

e.g..


 00112233
 -AABBCC-

In this diagram (assuming 0011.. is address/cache space with each pair of digits being a longword, and AABB.. is the pattern of requested misaligned-longwords)...

...then misaligned request AA will fill two cache entries at once - 00,11. Request BB will only miss on cache entry 22, since 11 is already filled (a partial hit) from the previous request. And so on for contiguous sequences...


It's quite different though for random-access to data, where it can miss on every word - and if the word is also misaligned, produce double the miss rate, effectively fetching 2x longs for every single word requested.

Sorry for the bad diagram btw. :)

D




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/