A Translation Lookaside Buffer (TLB) is a buffer (or cache) in a CPU that contains parts of the page table which translate from virtual into real addresses. This buffer has a fixed number of entries and is used to improve the speed of virtual address translation. The buffer is typically a content addressable memory (CAM) in which the search key is the virtual address and the search result is a real or physical address (which is often not the same thing). If the CAM search yields a match the translation is known and the match data are used. If no match exists the translation proceeds via the page table, which will take several more cycles to complete – particularly if the translation tables are swapped out into secondary storage.
The TLB references physical memory addresses in its table. The TLB may reside between the CPU and the cache, or between the cache and primary storage. This depends on whether the cache is using virtual addressing or physical 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 virtual memory system having 4KB pages, the lower 12 bits of the virtual address) do not change in the virtual-to-physical translation. On any cache access, there are two operations that are performed: an index into the cache's data store, and then a comparison of the tags for the cache line found. If the cache is structured in such a way that it can be indexed using only the bits that do not change in translation, the cache can perform its "index" operation while the TLB translates the upper bits of the address. Then, the translated address from the TLB is passed to the cache. The cache performs a tag comparison to determine if this access was a hit or miss. See the address translation section in the cache article for more details about virtual addressing as it pertains to caches and TLBs.
If a hit takes 1 clock cycle, a miss takes 30 clock cycles, and the miss rate is 1%, the effective memory cycle rate is clock cycles per memory access.
Virtual memory | Computer memory | Central processing unit
Translation Lookaside Buffer | Translation Lookaside Buffer | Translation Lookaside Buffer | トランスレーション・ルックアサイド・バッファ | Translation Lookaside Buffer | Translation Lookaside Buffer
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Translation Lookaside Buffer".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world