Lec14 Demandpage
Lec14 Demandpage
Caching and
Demand Paging
Processor
Control
Tertiary
Secondary
Storage
Second Storage
Main (Tape)
Level (Disk)
On-Chip
Registers
Memory
Cache
Block 1111111111222222222233
no. 01234567890123456789012345678901
TLB
64 entry, on-chip, fully associative, software TLB fault handler
TLB Lookup
Access
V Rights PA
20 10 2 4 bytes
page # disp 00
Hit/
Miss
FN = FN Data Hit/
Miss
Processor
TLB
Page
Table
Physical Disk
Virtual Memory 400GB
Memory 512 MB
4 GB
• Disk is larger than physical memory
– In-use virtual memory can be bigger than physical memory
– Combined memory of running processes much larger than
physical memory
» More programs fit into memory, allowing more concurrency
• Principle: Transparent Level of Indirection (page table)
– supports flexible placement of physical data
» Data could be on disk or somewhere across network
– variable location of data transparent to user program
» Performance issue, not correctness issue
10/19/05 Kubiatowicz CS162 ©UCB Fall 2005 Lec 14.15
Demand Paging is Caching
PWT
PCD
0 L D A UW P
(Physical Page Number) (OS)
31-12 11-9 8 7 6 5 4 3 2 1 0
Faulting
Faulting
Faulting
Faulting
Inst 1
Inst 1
Inst 2
Inst 2
User
TLB Faults
Fetch page/
OS Load TLB
Load TLB
Tail (LRU)