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.
Japanese name: ミスペナルティ
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.
Japanese name: ミスペナルティ
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.
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.
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.
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.
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.
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.
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.
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.
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.
Miss penalty appears in 9 practice questions across 1 topic, including Memory Hierarchy.
As an Amazon Associate I earn from qualifying purchases.
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.