Keeping frequently used translations nearby
Accessing a paged virtual address requires determining its physical location. A TLB stores selected translations and related access information, letting hits avoid repeated page-table walks.
Several nearby elements within one page can reuse a translation, illustrating spatial locality. Revisiting recently used pages can exploit temporal locality. The benefit depends on the access pattern and the translations the cache can retain.
References: [1]
A miss does not mean an absent page
On a miss, translation must be obtained from the mapping structures, through hardware walking or software handling depending on the architecture. A valid resident page can then be accessed without a disk transfer.
A TLB is distinct from a cache of instructions or data: it stores how to locate contents. Translation lookup, data access, and paging can therefore have different causes and costs and should be measured separately.
Correct caching needs invalidation
Different address spaces can map the same virtual page number differently. Switching must prevent inappropriate reuse, for example through invalidation or address-space identifiers.
Page-table edits can also leave stale cached translations. Linux provides address-space, range, and page invalidation interfaces, with multiprocessor handling covering the relevant CPUs. The performance benefit depends on maintaining this mapping consistency.