Re: [理工] [計組] 記憶體快取
※ 引述《steven1028 (Steven_Shie)》之銘言:
: 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 KB working set sequentially with the following address
: stream:
: 0, 4, 8, 12, 16, 20, 24, 28, 32....
: (1) Assume a 64 KB direct-mapped cache with a 32-byte line. 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.
cache size = 64KB
32-byte line => block size = 32B
所以總共2k個block
0 4 8 12 16 20 24 28 32 ...
M H H H H H H H M ...
=>Miss rate = 1/8
cache size或working set的大小不影響其Miss rate
Miss的原因:compulsory
: (2) Recompute the miss rate when the cache line size is 16 bytes, 64 bytes,
: and 128 bytes? What kind of locality is this workload exploiting?
16B:
0 4 8 12 16 20 24 28 32 ...
M H H H M H H H M ...
=> Miss rate = 1/4
64B:
0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 ...
M H H H H H H H H H H H H H H H M ...
=> Miss rate = 1/16
128B:
Miss rate = 1/32
利用的是spatial locality
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.240.189.24
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):