19. Paging TLBs Flashcards
What does TLB stand for?
Translation-lookaside buffer
Where is TLB located at?
It is part of the Memory Management Unit (MMU) and it’s a hardware cache.
What does the TLB do?
If there is a hit in the cache, the translation is performed quickly without indexing the page table.
Otherwise, it will retrieve the data from the page table and store it in the TLB. Then it retries again.
What is spatial locality?
The principle that if a program accesses a memory location, it is likely to access nearby memory locations again in the future.
What is temporal locality?
The principle that if a program access a memory location, it will most likely be re-assessed again soon.
Who handles the TLB miss?
Hardware or software (OS)
In olden days, it used to be the hardware only
In modern days, the OS will handle it using trap handler. The return-from-instruction will execute the instruction right before the TLB miss, because the TLB will now be a hit.
What is in a TLB?
VPN
PFN
other bits (such as valid bit, protection bit etc)
How does TLB handle context swtiches?
The hardware system will provide an address space identifier (ASID) that allows storing different translation of different processes at the same time.