What is TLB (translation lookaside buffer)?
A small cache that holds recent virtual-to-physical address translations. It avoids walking the page tables in memory on every access, speeding up address translation.
Japanese name: TLB(変換索引バッファ)
A small cache that holds recent virtual-to-physical address translations. It avoids walking the page tables in memory on every access, speeding up address translation.
Japanese name: TLB(変換索引バッファ)
On every fetch, load and store, the memory management unit (MMU) splits the virtual address into a virtual page number and a page offset; with 4 KB pages the low 12 bits are the offset and pass through untranslated. On a TLB hit, the stored physical page number is joined to the offset and permissions are checked in the same step. On a miss, a page-table walk reads the tables in memory, up to four levels for 48-bit addresses with 4 KB pages, and refills the entry. A page fault occurs only if the page-table entry is invalid or forbids the access.
TLB reach is entries times page size: 64 entries of 4 KB cover only 256 KB, while the same 64 entries holding 2 MB huge pages cover 128 MB. Because TLBs hold only tens to thousands of entries, programs with large or scattered working sets, such as databases and virtual machines, can spend a noticeable share of time walking page tables. Remedies include huge pages, a larger second-level TLB behind small first-level ones, keeping page-table entries in the data caches, and better locality.
The page table is the authoritative mapping, built by the operating system per process and stored in memory; the TLB caches recently used entries from it, so it holds translations, not data. Data caches are separate but cooperate closely: many L1 caches are virtually indexed and physically tagged (VIPT), selecting the set with untranslated offset bits so the set read and TLB lookup run in parallel, then comparing the physical tag. A cache miss is handled in hardware, whereas a page fault is an exception serviced by the OS.
Processes reuse the same virtual addresses, so stale translations must not survive an address-space change. Without tags the TLB is flushed on every switch, causing a burst of misses; tagging entries with an address space identifier (ASID) lets them be reused when a process returns. Mapping the kernel into every address space means system calls need no switch. When the OS changes a mapping, it must invalidate matching entries on every core that may hold them. With nested paging and four-level tables in both guest and host, one miss can cost up to 24 memory accesses.
Answer: B. 256 KB
Each TLB entry holds the translation for one page, so TLB reach = entries × page size = 64 × 4 KB = 256 KB. Programs that frequently touch a wider range suffer more TLB misses. With 2 MB huge pages, for example, the same 64 entries reach 64 × 2 MB = 128 MB. 64 KB results from mistaking the page size for 1 KB, and 4 MB from mistaking it for 64 KB.
The MMU (or an OS handler on some architectures) walks the page tables in memory to find the translation, installs it in the TLB and retries the access. If the page-table entry is invalid or the access is not allowed, a page fault is raised instead and the OS takes over.
Multiply the number of TLB entries by the page size. For example, 64 entries × 4 KB = 256 KB, while 64 entries × 2 MB = 128 MB, which is why huge pages reduce TLB misses.
It is a cache, but of address translations rather than data. It sits beside the L1 caches and is usually looked up in parallel with them, but it never holds the memory contents themselves.
TLB (translation lookaside buffer) appears in 7 practice questions across 3 topics, including Memory Hierarchy, CPUs and architecture, Performance Analysis.
As an Amazon Associate I earn from qualifying purchases.
This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.