Brief
Page Table

- Per Process
- large => in memory
- Upon every memory reference: address translation
- What does the hardware need to know?
- location of page table (Page Table Base Register[PTBR] in MMU)
- Points to start of page table of currently running process
- Privileged
- location of page table (Page Table Base Register[PTBR] in MMU)
Paging: Too Slow
- To do translation: Fetch Page Table Entry
- Extra memory reference
Solution: Hardware (Translation Lookaside Buffer [TLB])
- in CPU hardware that holds some number of “popular” translation
- Method: When Virtual address -> TLB,
- If VPN is in the TLB, “hit” use PFN in TLB, form physical addr, perform mem access
- If not, “miss”. Hardware: use PTBR to access page table, update TLB with necessary info. Try again => TLB hit
- What happens if TLB is full?
- Replacement
Page Table Structure
- Linear Page Table: Array
- Valid: v=1 prog can legally access the page, v=0 not
- PFN: if v=1, physical frame that holds the page
- Protection: read only, read/write, execute
TLB Contents
- Similar but different
- VPN in table (Hardware is going to search in parallel to see if there is a hit)
- PFN
- Protection Bit
- Valid Bit in TLB means that this entry has valid translation
- e.g.
running, TLB fills with VPN => PFN translation - timer interrupt, scheduler =>
- Can we run
=> no (because valid translations for in TLB) - Flush TLB (set valid for all entries to 0)
- PID
- e.g.
H/W Managed TLB:
- TLB miss => hardware accesses page table + update TLB