|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual memory: TLB |
|
|
|
|
|
|
|
How much does a page
fault cost? |
|
|
|
|
Time to determine page
is not in memory plus time to read the page from disk |
|
|
How much does a page hit
cost? |
|
|
|
|
1 memory access to find
page physical address + 1 memory access for data |
|
|
|
Cost of memory access has
doubled! |
|
|
|
Solution: cache the page
table |
|
|
|
|
Translation lookaside
buffer |
|
|
|
|
Contains most recently
used page table entries |
|
|
|
|
Associativity |
|
|
|
|
|
Small (128-256 entries):
fully associative |
|
|
|
|
|
Large: direct-mapped or
small associativity |
|
|
|
|
|
Idea: Locality in memory
references means super-locality in page references |
|
|
|
Table entries |
|
|
|
|
|
|
Tag holds virtual page
number |
|
|
|
|
|
|
|
Data entry holds physical
page address |
|
|
|
|
|
Also valid and dirty bits |
|
|
|
|
|
Look up virtual page
number in TLB |
|
|
|
|
|
Hit: use physical page
address to locate page |
|
|
|
|
Miss: can be handled in
hardware or software |
|
|
|
|
May be missing entry in
TLB or page fault |
|
|
|
|
|
|
Load page table entry in
TLB and try again |
|
|
|
|
If miss, then page fault |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fig 7.24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|