








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









TLBs Advanced paging techniques
More Paging Overview
Managing Page Tables (space) Efficient translations (time) Demand paged VM (space)
Sharing memory Copy on Write Mapped Files Page Tables Are Too Big
Map only what is being used Dynamically extend page table Doesn’t work if address space is sparse Two-level Page Tables
How does this use less memory?
Efficient Translations What is the cost of doing a memory lookup using original PT scheme? How about using two-level PTs? How can we fix this problem? (Access should be as fast as accessing PM) Translation Lookaside Buffer (TLB) Cache translations in hardware TLBs
Translate virtual page # into PTE (not phys addr) Can be done in single machine cycle (no memory access)
Fully associative cache (entries looked up in parallel) Cache tags are VPNs Cache values are PTEs With PTE+offset, what do you have?
Summary
Paged Virtual Memory
Move pages of virtual memory between PM and disk Initially, allocate virtual memory from PM Then, when PM is full, move some PM pages to “swap space” on disk. This movement is done by OS—TRANSPARENT TO APPLICATION
Virtual Memory Illustrated Virtual memory Physical Memory Disk Page Fault When a process accesses a page that has been evicted, a PAGE FAULT occurs (How can we keep track of which pages have been evicted?) 3 1 2
Back to Paging…
Cost of paging
effective access time = (1 – p ) * ma + p * page fault time What is the effective access time if p = 0.01, ma = 100ns, pft = 25ms? How can we ensure a degradation of less than 10%? 0.99 * 100 + 0.0125,000,000 = 99 + 2,500, 110 > 100 + 25,000,000p 10 > 25000,000*p p < 0.
Locality
Locations accessed recently likely to be accessed again.
Locations near each other accessed together Demand Paging
Page Replacement
Page replacement: Goals
The one that will never be used again (Or used in the longest amount of time)
Belady’s Algorithm
7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
Next time