16-vm-concepts

Algorithms too complicated and openended to be

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview:   These cache blocks are called pages (size is P = 2p bytes) Virtual memory VP 0 Unallocated VP 1 Cached Physical memory 0 Uncached Unallocated Cached Uncached Cached VP 2n ­p ­1 Uncached N ­1 Virtual pages (VPs) stored on disk 0 Empty PP 0 PP 1 Empty Empty M ­1 PP 2m ­p ­1 Physical pages (PPs) cached in DRAM 12 Carnegie Mellon DRAM Cache Organiza;on   DRAM cache organiza;on driven by the enormous miss penalty   DRAM is about 10x slower than SRAM   Disk is about 10,000x slower than DRAM   Consequences   Large page (block) size: typically 4 ­8 KB, some2mes 4 MB   Fully associa2ve Any virtual page (VP) can be placed in any physical page (PP)   Requires a “large” mapping func2on – different from CPU caches   Highly sophis2cated, expensive replacement algorithms   Too complicated and open ­ended to be implemented in hardware   Write ­back rather than write ­through   13 Carnegie Mellon Enabling data structure: Page Table   A page table is an array of page table entries (PTEs) that maps virtual pages to physical pages   Per ­process kernel data structure in DRAM Physical page number or Valid disk address PTE 0 0 null 1 1 0 1 0 0 PTE 7 1 null Physical memory (DRAM) VP 1 VP 2 VP 7 VP 4 PP 0 PP 3 Virtual memory (disk) VP 1 Memory resident page table (DRAM) VP 2 VP 3 VP 4 VP 6 VP 7 14 Carnegie Mellon Page Hit   Page hit: reference to VM word that is in physical memory (DRAM cache hit) Virtual address Physical page number or Valid disk address PTE 0 0 null 1 1 0 1 0 0 PTE 7 1 null Physical memory (DRAM) VP 1 VP 2 VP 7 VP 4 PP 0 PP 3 Virtual memory (disk) VP 1 Memory resident page table (DRAM) VP 2 VP 3 VP 4 VP 6 VP 7 15 Carnegie Mellon Page Fault   Page fault: reference to VM word that is not in physical memory (DRAM cache miss) Virtual address Physical page number or Valid disk address PTE 0 0 null 1 1 0 1 0 0 PTE 7 1 null Physical memory (DRAM) VP 1 VP 2 VP 7 VP 4 PP 0 PP 3 Virtual memory (disk) VP 1 Memory resident page table (DRAM) VP 2 VP 3 VP 4 VP 6 VP 7 16 Carnegie Mellon Handling Page Fault   Page miss c...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online