Line size of L1 and L2 caches

prathmesh.kallurkar picture prathmesh.kallurkar · Feb 5, 2013 · Viewed 94.2k times · Source

From a previous question on this forum, I learned that in most of the memory systems, L1 cache is a subset of the L2 cache means any entry removed from L2 is also removed from L1.

So now my question is how do I determine a corresponding entry in L1 cache for an entry in the L2 cache. The only information stored in the L2 entry is the tag information. Based on this tag information, if I re-create the addr it may span multiple lines in the L1 cache if the line-sizes of L1 and L2 cache are not same.

Does the architecture really bother about flushing both the lines or it just maintains L1 and L2 cache with the same line-size.

I understand that this is a policy decision but I want to know the commonly used technique.

Answer

Axel Borja picture Axel Borja · Mar 1, 2013

Cache-Lines size is (typically) 64 bytes.

Moreover, take a look at this very interesting article about processors caches: Gallery of Processor Cache Effects

You will find the following chapters:

  1. Memory accesses and performance
  2. Impact of cache lines
  3. L1 and L2 cache sizes
  4. Instruction-level parallelism
  5. Cache associativity
  6. False cache line sharing
  7. Hardware complexities