Using Main Memory as a Cache DRAM VS disk is more extreme than SRAM vs DRAM Access latencies DRAM w10X slower than SRAM Disk 100,000X slower than DRAM Bottom line: Design decisions made for dRam caches driven by enormous cost of misses
16 Using Main Memory as a Cache • DRAM vs. disk is more extreme than SRAM vs. DRAM – Access latencies: • DRAM ~10X slower than SRAM • Disk ~100,000X slower than DRAM – Bottom line: • Design decisions made for DRAM caches driven by enormous cost of misses
Design Considerations Line size? Large since disk better at transferring large blocks Associativity? High to minimize miss rate Write through or write back? Write back since can 't afford to perform small writes to disk Write back: defers the memory update as long as possible by writing the updated block to memory only when it is evicted from the cache by the replacement algorithm
17 Design Considerations • Line size? – Large, since disk better at transferring large blocks • Associativity? – High, to minimize miss rate • Write through or write back? – Write back, since can’t afford to perform small writes to disk Write back: defers the memory update as long as possible by writing the updated block to memory only when it is evicted from the cache by the replacement algorithm
10.3.2 Page Tables
18 10.3.2 Page Tables
Page Virtual memory Organized as an array of contiguous byte-sized cells stored on disk conceptually each byte has a unique virtual address that serves as an index into the array The contents of the array on disk are cached in maIn memory
19 Page • Virtual memory – Organized as an array of contiguous byte-sized cells stored on disk conceptually. – Each byte has a unique virtual address that serves as an index into the array – The contents of the array on disk are cached in main memory
Page P695 The data on disk is partitioned into blocks Serve as the transfer units between the disk and the main memory virtual pages(VPs) physical pages(PPs) Also referred to as page frames
20 Page P695 • The data on disk is partitioned into blocks – Serve as the transfer units between the disk and the main memory – virtual pages (VPs) – physical pages (PPs) • Also referred to as page frames