Virtual Memory
2026-10-31
What do you think the following bash code does?
Hint: x>&y tells bash to copy file descriptor y to x; defaults are 2 and 1.
pwd works)
cd and sourceThis is the first differentiated assignment!
Please give me and TAs constructive feedback
Goal for midterm feedback is to make this semester better
This module: Unix abstractions
(Yes, some overlap with 3410/4410.)
Any problem in computer science can be solved with another level of indirection. – Roger Deedham or David Wheeler, probably
Of course, there are details…
For each page, a Page Table Entry (PTE) tracks
All there for a reason! PFN is obvious, but:
W^X)(Protection supports other cases, too…)
libc) - Usually read-onlyForked process gets clone of page table
Huzzah for lazy updates!
After a fork with copy-on-write optimization, which is true?
Respond at: https://PollEv.com/davidbindel252 or send davidbindel252 to 22333
Concept: Memory is just another cache!
On read/write to page that is not present
Can also map named files to memory ranges!
Dangerous with writer + anyone else…
Direct memory access (DMA) for more general I/O!
What happens on heap allocations?
Behind the scenes, new pages = adjust heap segment:
Two things should worry you:
Usually use a subset of 64-bit address space; for x86-64:
| Bits | Addressable space | |
|---|---|---|
| All | 64 | 16 EB |
| Physical | 52 | 4 PB |
| Virtual | 48 | 256 TB |
Idea: Keep a tree vs array (linear page table)
Doesn’t explicitly represent many un-mapped pages
Virtual-to-physical better be fast!
TLB caches the virtual-to-physical map
A TLB miss can be very expensive
Rare with good spatial locality…
Consider a system with 4KB pages, a 64 entry fully associative L1 TLB, and 9 bits for a top-level directory index, how large an array can be accessed sequentially before an L1 TLB miss?
Respond at: https://PollEv.com/davidbindel252 or send davidbindel252 to 22333
On Ed: What works well for engagement in your other big classes?