P3L2 Flashcards
(32 cards)
Principles of Memory Management Systems
- ) Use intelligently sized containers
- ) Nota ll memory is needed at once
- ) Optimized for performance
Memory Management Goals
Allocate and Arbitrate
Allocate
map pages from virt mem into page frames from physical
Arbitrate
page tables
MMU
- translate virtual to physical accesses
- report faults
What causes faults
illegal access
permission
not present in mm
HW Support Registers
Pointers to page table
base and limit size, number of segments
Cache - TLB
Translation Lookaside Buffer
VPN
Virtual Page Number
PFN
Page Frame Number
Page tables are per
process
Page Table Flags
- Present (valid/invalid)
- Dirty
- Accessed
- R/W (permission bit)
- U/S (permission bit - user / supervisor)
Page Fault when
H/W determines a physical mem access cannot be performed
Page Fault Handler
determines action based on error code and faulting addr
Hierarchical Page Tables
Outer page table == Page Table Directory
Internal page table == only for valid virtual memory regions
Multi-level PT Tradeoffs
Smaller internal page tables / directories
but more memory accesses required for translation
Page Table Cache
Translation Lookaside Buffer
MMU Level address translation cache
Why small number of cached entry = high TLB hit rate
temporal and spacial locality
Example of inverted page tables
Hashing Page Tables
Memory allocator
determines VA to PA mapping
Memory Allocation Challenges
permit coalescing / aggregation of free areas
avoid or limit extend of fragmentation
Allocators in Linux
Buddy
Slab
Buddy
Start with 2^x, split into powers of two until can satisfy request
-Aggregation works well and fast
Slab allocator
-caches for common object type/sizes on top of contiguous memory