120 likes | 313 Views
Memory Hierarchy. Storage Technology Trends Memory Bandwidth Requirements Hierarchical Structure Locality of Reference Caching Operating Systems Support - Virtual Memory, I/O, FileSystems. Storage Technology Trends. CPU Speeds vs. (Storage) Access Rates
E N D
Memory Hierarchy • Storage Technology Trends • Memory Bandwidth Requirements • Hierarchical Structure • Locality of Reference • Caching • Operating Systems Support - Virtual Memory, I/O, FileSystems
Storage Technology Trends • CPU Speeds vs. (Storage) Access Rates • SRAMs have kept up with high growth rates in CPU speed • DRAMs and disks have not • Disk Seek times in particular have grown really slowly • Same is true for initial setup/spooling time for tapes
Hierarchy • early days - register set, primary, secondary, archival • multi-level inclusion • present day - register set, L1 cache, L2 cache, RAM, Disk, Networked storage, Web storage, archival
Locality of Reference • Locality Principle: Locus of memory references is small. • Temporal • Spatial • Sequential (Stride-1)
Performance • t-eff = t_h + Pmiss (t_h+1 - t_h) • mem. eff = 100 / (1 + Pmiss (R-1)) • R = t_h+1/t_h • M.e. = 100 when R=1 or Pmiss=0 • Consider R=10 (SRAM), 50(DRAM), 10000 (disk) • What is a good Pmiss for each?
Caching • Caching brings the levels closer • caches are transparent • L1, L2 cache (OS/App*) • Buffer(App), Disk cache(OS/App), network client cache, browser cache(OS/app), proxy cache(OS/app), distribution cache(OS/app/client)
OS Support • Virtual Memory • I/O • File Systems
Virtual Memory • Virtual addressing vs. Physical addressing • Virtual address space determined typically by instruction set, (address) word size • Translation needed • Treat RAM as cache • Demand Paging • (unallocated, cached, uncached) • Mapping (table) maintained by OS in RAM • Split, Lookup, and combine performed by MMU (part of architecture). • Page Fault – page moved from disk to RAM replacing a cached page
Input Output at architectural level • Memory vs. Disk • Direct bus for memory • Disk shares bus with other I/O devices • Recall speed mismatch • Thus Disk access is done via I/O operations • Asynchronous operation (interrupts, DMA)
I/O at OS (unix) level • Programs vs. OS Kernel • Kernel does not impose structure on I/O • I/O is done using “streams of bytes” • Unix processes • Use descriptors (for file, pipe, socket) • I/O devices are treated as files
I/O Devices • Structured (block) or unstructured (character) • I/O operations are handled by kernel-resident software modules • Device drivers • System calls (open, pipe, socket, mknod, ioctl, read, write) • Scatter/Gather I/O