computer-architecture memory

Definition

Temporal Locality Compulsory Cache Miss

A temporal locality compulsory cache miss is a cache miss that occurs on the first access to a block, before temporal memory locality can be exploited.

Since the block has not been loaded into the cache before, the access must miss even if the cache has enough capacity and there are no conflicts.

Such misses are therefore caused by the first reference to a block, not by replacement or set contention.

Example

First iteration misses, later iterations hit

Consider a loop that repeatedly loads the three words at addresses 4, 12, and 8:

addi s0, zero, 5
addi s1, zero, 0
LOOP:
  beq  s0, zero, DONE
  lw   s2, 4(s1)
  lw   s3, 12(s1)
  lw   s4, 8(s1)
  addi s0, s0, -1
  j    LOOP
DONE:

Suppose these three words fit in different cache sets, so they do not evict one another.

Then the first three loads miss, because the blocks have not been brought into the cache yet. After that, the same three blocks are reused in each loop iteration, so the later accesses hit.

Over loop iterations, the program performs loads in total. The first are compulsory misses and the remaining are hits, so the miss rate is