TLB - L1/L2 Cache

Translation Lookaside Buffer (TLB): Small HW cache on MMU for recently used pages (typically 16-64 pages, so 64-256KB memory)

TLB Management:

Page Policies

Demand Paging

Page Fault: Accessing an evicted (invalid) PTE

Page Daemon: A kernel thread to proactively evict pages when memory is close to full

Locality

Temporal Locality: Locations referenced recently are likely to be reference again (e.g. for loop index i)

Spatial Locality: Locations close by are likely to be referenced soon (e.g. sequential array access)

Paging Policies ⭐

Placement Policy: Where to put a page (469: placement impacts performance more when lots of memory is available)

Fetch Policy: When to swap a frame into memory

Replacement Policy: Which page to evict? (evaluated by counting number of page faults over a reference string)