Chapter 5: 5. (page 489)
Media applications that play audio or video files are part of a class of workloads called “streaming” workloads; i.e., they bring in large amounts of data but do not reuse much of it. Consider a video streaming workload that accesses a 512 KiB working set sequentially with the following address stream:
0, 2, 4, 6, 8, 10, 12, 14, 16, …
5.5.1 Assume a 64 KiB direct-mapped cache with a 32-byte block. What is the miss rate for the address stream above? How is this miss rate sensitive to the size of the cache or the working set? How would you categorize the misses this workload is experiencing, based on the 3C model?
5.5.2 Re-compute the miss rate when the cache block size is 16 bytes, 64 bytes, and 128 bytes. What kind of locality is this workload exploiting?
5.5.3 “Prefetching” is a technique that leverages predictable address patterns to speculatively bring in additional cache blocks when a particular cache block is accessed. One example of prefetching is a stream buffer that prefetches sequentially adjacent cache blocks into a separate buffer when a particular cache block is brought in. If the data is found in the prefetch buffer, it is considered as a hit and moved into the cache and the next cache block is prefetched. Assume a two-entry stream buffer and assume that the cache latency is such that a cache block can be loaded before the computation on the previous cache block is completed. What is the miss rate for the address stream above?
Cache block size (B) can affect both miss rate and miss latency. Assuming a 1-CPI machine with an average of 1.35 references (both instruction and data) per instruction, help find the optimal block size given the following miss rates for various block sizes.
8;4% | 16:3% | 32:2% | 64:1.5% | 128:1% |
5.5.4 What is the optimal block size for a miss latency of 20×B cycles?
5.5.5 What is the optimal block size for a miss latency of 24+B cycles?
5.5.6 For constant miss latency, what is the optimal block size
Short Answer
5.5.1
Miss rate
5.5.2
if the cache block size is 16 byte
the miss rate for the given address stream is
if the cache block size is 64 byte
The miss rate for the given address stream is
If the cache block size is 128 byte
The miss rate for the given address stream is
andthe workload is exploiting spatial locality
5.5.3
The miss rate is 0.00038% = 0%
5.5.4
B = 8 is the optimal block size
5.5.5
B=32 is the optimal block size
5.5.6
B = 128 is optimal