Lecture Slides 09 093-Vmascache
Lecture Slides 09 093-Vmascache
Lecture Slides 09 093-Vmascache
~4 MB ~4 GB ~500 GB
L1
I-cache
L2
Main
32 KB unified
cache Memory
L1
CPU Reg
D-cache
Consequences?
Block size?
Associativity?
Write-through or write-back?
Consequences
Large page (block) size: typically 4-8 KB, sometimes 4 MB
Fully associative
Any VP can be placed in any PP
Requires a “large” mapping function – different from CPU caches
Highly sophisticated, expensive replacement algorithms
Too complicated and open-ended to be implemented in hardware
Write-back rather than write-through
Virtual Memory as Cache
University of Washington
...
M-1:
Data word
Valid bit = 0:
page not in memory
(page fault)
Page Hit
Page hit: reference to VM byte that is in physical memory
Physical memory
Physical page (DRAM)
Virtual address
number or
VP 1 PP 0
Valid disk address
VP 2
PTE 0 0 null
VP 7
1 VP 4 PP 3
1
0
1
0 null Virtual memory
0 (disk)
PTE 7 1 VP 1
Memory resident VP 2
page table
VP 3
(DRAM)
VP 4
VP 6
VP 7
Virtual Memory as Cache
University of Washington
Page Fault
Page fault: reference to VM byte that is NOT in physical
memory
Physical memory
Physical page (DRAM)
Virtual address
number or
VP 1 PP 0
Valid disk address
VP 2
PTE 0 0 null
VP 7
1 VP 4 PP 3
1
0
1
0 null Virtual memory
0 (disk)
PTE 7 1 VP 1
Memory resident VP 2
page table
VP 3
(DRAM)
VP 4
What happens when a page
VP 6
fault occurs?
VP 7
Virtual Memory as Cache
University of Washington
User Process OS
Physical memory
Physical page (DRAM)
Virtual address number or
VP 1 PP 0
Valid disk address
VP 2
PTE 0 0 null
VP 7
1 VP 4 PP 3
1
0
1
0 null Virtual memory
0 (disk)
PTE 7 1 VP 1
Memory resident VP 2
page table
VP 3
(DRAM)
VP 4
VP 6
VP 7
Virtual Memory as Cache
University of Washington
Physical memory
Physical page (DRAM)
Virtual address number or
VP 1 PP 0
Valid disk address
VP 2
PTE 0 0 null
VP 7
1 VP 4 PP 3
1
0
1
0 null Virtual memory
0 (disk)
PTE 7 1 VP 1
Memory resident VP 2
page table
VP 3
(DRAM)
VP 4
VP 6
VP 7
Virtual Memory as Cache
University of Washington
Physical memory
Physical page (DRAM)
Virtual address number or
VP 1 PP 0
Valid disk address
VP 2
PTE 0 0 null
VP 7
1 VP 3 PP 3
1
1
0
0 null Virtual memory
0 (disk)
PTE 7 1 VP 1
Memory resident VP 2
page table
VP 3
(DRAM)
VP 4
VP 6
VP 7
Virtual Memory as Cache
University of Washington