Professional Documents
Culture Documents
Computer Architecture
Memory Management Units
systems
Virtual Address Space
Each user has a private address space
Addresses 0 to 2q-1
q and p not necessarily the same!
User Ds
Address
Space
Virtual Addresses
Memory Management Unit
CPU (running user programs) emits Virtual
Address
MMU translates it to Physical Address
Operating System allocates pages of physical
memory to users
Virtual Addresses
Mappings between user space and physical
memory created by OS
CPU
MMU
D or I
PA
PA
Cache
D
or
I
Main
Mem
MMU - operation
OS constructs page tables one for each user
Page address from memory address
selects a page table entry
Page table entry contains physical page
address
MMU - operation
q-k
Page Fault
q-k
MMU - practicalities
Page size
8 kbyte pages k = 13
p = 32
p - k = 19
So page table size
219 = 0.5 x 106 entries
Each entry 4 bytes
0.5 x 106 4 = 2 Mbytes!
MMU - practicalities
Page tables are stored in main memory
Theyre too large to be in smaller memories!
MMU needs to read PT for address translation
Address translation can require additional
memory accesses!
PowerPC
address
formation
MMU - Protection
Page table entries
Access control bits
Read
Write
Read/Write
Execute only
Program - text in Unix
Read only
Data
Read write
10
11
1
0
MMU - Sharing
Can map virtual addresses
from different user spaces to
same physical pages
Sharing of data
Commonly done for frequently used programs
Unix sticky bit
Text editors, eg vi
Compilers
Any other program used by multiple users
More efficient memory use
Less paging
Better use of cache
(TLB or TLAB)
Small cache of recently-used page table entries
Usually fully-associative
Can be quite small!
MIPS R4000
1992
MIPS R10000
1996
HP PA7100
1993
Pentium 4 (Prescott) 2006
48 entries
64 entries
120 entries
64 entries
TLB - Coverage
How much of the address space is
covered by the TLB?
ie how large is the address space for which
the TLB will ensure fast translations?
All others will need to fetch PTEs from cache,
main memory or (hopefully not too often!) disc
TLB - Coverage
Hit =
Page found in RAM