What is Miss penalty?

The extra time needed to fetch data from the next level when a cache miss occurs, determined by the lower level's access time and the line transfer time.

Field: Memory Hierarchy

Japanese name: ミスペナルティ

What sets the miss penalty

The miss penalty is the time to fetch the missing line from the next level of the hierarchy. It has two parts: the latency until the first data arrives and the transfer time for the rest of the line, which is line size divided by bandwidth. In a multilevel hierarchy, the L1 miss penalty is simply the average access time of L2. With a 10 ns L2 hit time, a 20% L2 local miss rate and 100 ns main memory, the L1 miss penalty is 10 + 0.2 × 100 = 30 ns, far shorter than going straight to memory.

How it enters AMAT and CPI

Average memory access time (AMAT) is hit time + miss rate × miss penalty. With a 2-cycle hit time, a 4% miss rate and a 150-cycle penalty, AMAT is 2 + 0.04 × 150 = 8 cycles, four times the hit time. In CPI terms, an ideal CPI of 1.0 with 1.3 memory accesses per instruction, a 2% miss rate and a 100-cycle penalty gains 1.3 × 0.02 × 100 = 2.6 stall cycles, giving a CPI of 3.6. A large penalty turns even small miss rates into large slowdowns.

Why miss rate alone can mislead

Larger or more associative caches reduce the miss rate but may lengthen the hit time, and larger lines exploit spatial locality but raise the miss penalty because each miss transfers more data. Designs must therefore be compared by AMAT, not miss rate. With a 20-cycle penalty, a cache with a 1-cycle hit and 5% miss rate averages 1 + 0.05 × 20 = 2.0 cycles, while one with a 2-cycle hit and 4% miss rate averages 2 + 0.04 × 20 = 2.8 cycles, so the cache with the lower miss rate is slower.

Techniques that cut the effective penalty

Adding cache levels shortens the trip for most misses. Critical word first sends the word the CPU requested before the rest of the line, and early restart lets execution resume as soon as that word arrives. Non-blocking caches keep serving hits while a miss is outstanding, and out-of-order cores overlap several misses so their latencies partly hide one another. Prefetching hides the penalty by fetching ahead; a useful rule of thumb sets the prefetch distance to roughly the miss penalty divided by the time per loop iteration.

Try it: questions about Miss penalty

With a cache hit time of 2 cycles, a miss rate of 4% and a miss penalty of 150 cycles, what is the average memory access time in cycles?

  1. A8 cycles
  2. B6 cycles
  3. C152 cycles
Show answer and explanation

Answer: A. 8 cycles

Average memory access time = hit time + miss rate × miss penalty = 2 + 0.04 × 150 = 2 + 6 = 8 cycles. The hit time applies to every access, and the miss penalty is added only on misses. 6 cycles omits the hit time, counting only the misses. 152 cycles is the time for a single access that misses, not the average. Even a 4% miss rate quadruples the average.

A processor has an average CPI of 1.0 with a perfect cache. Each instruction makes 1.3 memory accesses on average, with a 2% miss rate and a 100-cycle miss penalty. What is the actual average CPI?

  1. A3.0
  2. B3.6
  3. C1.3
Show answer and explanation

Answer: B. 3.6

Memory stall cycles per instruction are 1.3 accesses × 0.02 × 100 cycles = 2.6 cycles. Adding them to the ideal CPI gives 1.0 + 2.6 = 3.6, so performance falls to 1/3.6 of ideal. 3.0 wrongly assumes one access per instruction (1.0 + 1 × 0.02 × 100). 1.3 is the number of accesses per instruction, not the CPI. Even a small miss rate badly hurts performance when the miss penalty is large.

FAQ

How do you calculate miss penalty in a two-level cache?

The L1 miss penalty equals the L2 average access time: L2 hit time plus L2 local miss rate times the main memory access time. For example, 10 ns + 0.2 × 100 ns = 30 ns.

What is the difference between miss rate and miss penalty?

Miss rate is the fraction of accesses that miss in the cache, while miss penalty is the extra time each miss costs. Average access time depends on their product plus the hit time.

Does a larger cache line increase the miss penalty?

Yes. Each miss must transfer more bytes, so the transfer part of the penalty grows, even though larger lines can reduce the number of misses for code with good spatial locality.

Questions that mention Miss penalty (7)

Miss penalty appears in 9 practice questions across 1 topic, including Memory Hierarchy.

  1. With an L1 hit time of 1 ns and miss rate of 5%, an L2 hit time of 10 ns and local miss rate of 20%, and main memory access time of 100 ns, what is the average memory access time?
  2. What is the effect of increasing a cache's line size?
  3. When inserting software prefetch instructions, which statement about how far ahead to fetch (the prefetch distance) is correct?
  4. In a multilevel cache with an L2 below the L1, what is the L2's main role?
  5. If the cache hit rate is 95%, what is the miss rate?
  6. Which technique, when fetching a missed line from memory, sends the word the CPU needs first and the rest afterward?
  7. Why must cache designs be compared by average memory access time rather than miss rate alone?

Books on Memory Hierarchy Ad

As an Amazon Associate I earn from qualifying purchases.

Comparisons that include this term

Semiconductor, Electronics and Computing Calculators

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary