Translation Lookaside Buffer Article Index for
Translation
Website Links For
Translation
 

Information About

Translation Lookaside Buffer





OVERVIEW

The TLB references physical memory addresses in its table. It may reside between the CPU and the CPU Cache or between the CPU cache and Primary Storage memory. This depends on whether the cache uses physical or virtual addressing. If the cache is virtually addressed, requests are sent directly from the CPU to the cache, which then accesses the TLB as necessary. If the cache is physically addressed, the CPU does a TLB lookup on every memory operation, and the resulting physical address is sent to the cache. There are pros and cons to both implementations.

A common optimization for physically addressed caches is to perform the TLB lookup in parallel with the cache access. The low-order bits of any virtual address (e.g., in a section in the cache article for more details about virtual addressing as it pertains to caches and TLBs.


MISS

Two schemes for handling TLB misses are commonly found in modern architectures:
  • With hardware TLB management, the CPU itself walks the Exception , which the Operating System must handle. Handling page faults usually involves bringing the requested data into physical memory, setting up a page table entry to map the faulting virtual address to the correct physical address, and restarting the program (see Page Fault for more details.)

  • With software-managed TLBs, a TLB miss generates a "TLB miss" exception, and the operating system must walk the page tables and perform the translation in software. The operating system then loads the translation into the TLB and restarts the program from the instruction that caused the TLB miss. As with hardware TLB management, if the OS finds no valid translation in the page tables, a page fault has occurred, and the OS must handle it accordingly.



TYPICAL STATISTICS

:Size: 8 - 4,096 entries
:Hit time: 0.5 - 1 clock cycle
:Miss penalty: 10 - 30 clock cycles
:Miss rate: 0.01% - 1%

If a TLB hit takes 1 clock cycle, a miss takes 30 clock cycles, and the miss rate is 1%, the effective memory cycle rate is an average of 1 imes 0.99 + (1 + 30) imes 0.01 = 1.30 clock cycles per memory access.


USAGE

All current x86 processors use a TLB. In some newer processors it is even possible to share a single entry between different processors even if their access rights differ. This practice improves RAM access times.


SEE ALSO