Hardware Support For Virtual Memory: CS2100 - Computer Organization
Hardware Support For Virtual Memory: CS2100 - Computer Organization
Hardware support
for virtual memory
Increasing
distance
from the
processor in
access time
L1$
8-32 bytes (block)
L2$
1 to 4 blocks
Main Memory
Inclusive what
is in L1$ is a
subset of what
is in L2$ is a
subset of what
is in MM that is
a subset of is
in SM
Secondary Memory
Virtual Memory
Provides the ability to easily run programs larger than the size of
physical memory
Protection,
Translation,
Sharing
Program 2
virtual address space
Address Translation
. . .
12 11
. . .
Page offset
Translation
. . .
Page offset
12 11
10
11
Offset
Physical page #
Offset
Physical page
V
base addr
1
1
1
1
1
1
0
1
0
1
0
Main memory
Page Table
(in main memory)
Disk storage
12
13
miss
PA
Translation
Cache
Main
Memory
hit
data
Tag
Physical page
base addr
1
1
1
0
1
Physical page
V
base addr
1
1
1
1
1
1
0
1
0
1
0
TLB
Main memory
Page Table
(in physical memory)
Disk storage
15
Virtual Page #
Physical Page #
Dirty
Ref
Access
Who is
permitted to do
what on this
page, i.e.
access rights.
TLBs are typically not more than 128 to 256 entries even on high
end machines
16
t
TLB
Lookup
miss
hit
PA
miss
Cache
Main
Memory
hit
Translation
data
If the page is loaded into main memory, then the TLB miss can be
handled (in hardware or software) by loading the translation information
from the page table into the TLB
- Takes 10s of cycles to find and load the translation info into the TLB
If the page is not in main memory, then its a true page fault
- Takes 1,000,000s of cycles to service a page fault
TLB misses are much more frequent than true page faults
17
TLBs
Total size
16,000 to
16 to 512
250,000 words entries
250,000 to
1,000,000,000
4000 to 64,000 4 to 32
10,000,000 to
100,000,000
10 to 1000
Miss rates
0.00001% to
0.0001%
0.01% to
2%
0.25 to 16
18
AMD Opteron
19
Page
Table
Hit
Hit
Hit
Hit
Hit
Miss
Miss
Hit
Hit
Miss
Hit
Miss
Miss
Miss
Miss
Hit
Miss
Miss/
Hit
Miss
Miss
Hit
21
22
Works when the high order bits of the VA are used to access the
TLB while the low order bits are used as index into cache
Block offset
Index
VA Tag
PA
Tag
Tag Data
Tag Data
PA Tag
TLB Hit
=
23
Translation
PA
Main
Memory
Cache
hit
data
but
24
Disk placement
- Bootstrap (e.g., out of disk sector 0) so the system can service a
limited number of page faults before the OS is even loaded
25
Summary
2.
3.
4.
26