0

I was going through "Mechanical Sympathy talk" by Teiva Harsanyi.
https://www.youtube.com/watch?v=cetmDfqr2BU

I am facing problem understanding the concept of Critical Stride. I understand critical stride happens when every cache line mapped to the same set. But I dont really understand how one can say "it will take these many elements to for critical stride" Particularly the below mentioned slide, I did not get at all (specially the critical stride formula) and how 512 elements lead to critical stride:

enter image description here

Could you please help me understand it.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Tarun
  • 3,162
  • 3
  • 29
  • 45
  • 2
    The cache indexing function for private caches (e.g. L1 and L2) is very simple, just taking the address bits between the offset-within-line and the tag. So it's basically `address % size` and rounded down (or right shifted), for a power-of-2 size. L3 indexing uses a more complicated hash to be resistant to aliasing, and to distribute adjacent lines to different "slices". [Determine Cpu cache associativity](https://stackoverflow.com/q/53764676) / [According to Intel my cache should be 24-way associative though its 12-way, how is that?](https://stackoverflow.com/q/37162132) – Peter Cordes Aug 22 '23 at 19:37

1 Answers1

0

This definition of critical stride helped me understand it:
(critical stride) = (number of sets) * (line size)
Its a way to identify the distance between memory addresses that will map to the same cache set. This can help avoid cache conflicts due to stride patterns that match the cache's organization.

If a element at address X belong to set A, element located at address X+critical stride will also be mapped to set A.

Tarun
  • 3,162
  • 3
  • 29
  • 45