📝 TLB reach in Virtual Memory (9 MCQs)
Virtual Memory Coverage Provided by Translation Lookaside Buffers
TLB reach is the amount of virtual memory that can be covered by the translations stored in a translation lookaside buffer at one time. It depends on the number of usable TLB entries and the page size associated with those entries. Greater reach allows a process to access a larger resident address region without repeatedly missing in the translation cache and performing page-table walks.
Why Limited Translation Coverage Creates Performance Costs
Processors can access many virtual pages during program execution, but TLBs have limited entry capacity. When a working set exceeds available translation coverage, frequently used mappings may be evicted and later required again. Each TLB miss adds translation overhead, even when the physical page is already resident. Increasing TLB reach can reduce this pressure for suitable access patterns.
Calculating TLB Reach from Entries and Page Size
For a TLB containing E entries with a uniform page size P, basic TLB reach equals E multiplied by P. This calculation assumes every entry contributes one distinct translation and ignores implementation-specific organisation, multiple page sizes, and instruction/data separation. Effective reach may also depend on address-space identifiers and the number of entries available to an individual process.
Comparing Translation Coverage with Different Page Sizes
Suppose a TLB contains 64 entries and each maps a 4 KB page. Its basic reach is 256 KB. If the same number of entries maps 2 MB pages, its reach becomes 128 MB. The larger-page configuration covers substantially more memory, although it may introduce internal fragmentation and require larger aligned regions.
Reducing TLB Misses Through Larger Reach
Greater TLB reach can improve performance when the active memory footprint is large and exhibits locality. Systems can increase reach through larger pages, additional TLB entries, or separate translation structures. However, larger pages are not universally beneficial because they may waste memory or complicate allocation. TLB misses also differ from page faults because a missing cached translation does not necessarily mean the page is absent from RAM.
Clarifying TLB Reach and Physical Memory
'TLB reach equals the total physical RAM size' is incorrect because it measures translation-cache coverage. 'A TLB miss always causes a disk operation' is incorrect because a valid page-table mapping may resolve the miss. 'Doubling page size always doubles application performance' is incorrect because reach increases, but actual speed depends on locality and other system costs.
Exam Focus: TLB Reach and Entry Calculations
Calculate TLB reach by multiplying entry capacity by mapped page size, using consistent units. Compare configurations containing different entry counts and page sizes. Identify whether the stated TLB is shared, split, or supports multiple page sizes before applying the basic formula. Explain how translation coverage influences TLB misses without confusing them with demand-paging faults.
Key Terms of TLB Reach
- TLB reach - Virtual memory covered by translations.
- TLB entry - Cached address mapping.
- Page size - Bytes represented by one mapping.
- TLB miss - Translation absent from cache.
- Translation coverage - Range represented by cached mappings.
- Large page - Mapping with greater page size.
📝 All TLB reach in Virtual Memory MCQs
Q1. A process triggers a page fault while all frames are occupied. Which action is most commonly taken by the operating system to resolve the fault?
📖 Explanation: Swapping out a process is the standard response when no free frames exist. The OS selects a victim process, writes its pages to swap, and releases those frames for the faulting page. Terminating the process would waste work, allocating extra frames is impossible without virtual memory tricks, and ignoring the fault would crash the program. This mirrors real systems where swapping maintains progress while preserving user work.
Q2. Given the reference string 7,0,1,2,0,3,0,4,2,3,0,3,2 and three physical frames, which replacement policy results in the fewest page faults?
📖 Explanation: LRU replaces the page that has not been used for the longest time, which matches the pattern of the reference string and yields fewer faults than FIFO, which evicts pages in arrival order regardless of recent use. OPT would be ideal but is not implementable; RAND is unpredictable. In practice, LRU‑like heuristics are chosen because they minimize faults, improving system performance.
Q3. If a TLB holds 64 entries and each page is 4 KB, what is the maximum memory that can be accessed without a TLB miss?
📖 Explanation: TLB reach equals the number of entries multiplied by the page size: . This is the largest virtual address space that can be covered entirely by TLB entries, so every access within that range hits the TLB. Smaller numbers underestimate the reach, and larger numbers assume more entries than exist. Understanding this helps designers size the TLB relative to expected workloads.
Q4. A TLB contains 128 entries. Which page size gives the greatest TLB reach: 2 KB, 4 KB, 8 KB, or 16 KB?
📖 Explanation: TLB reach is calculated as entries × page size. For 128 entries: 2 KB → 256 KB, 4 KB → 512 KB, 8 KB → 1 MB, 16 KB → 2 MB. The largest reach comes from the 16 KB page size, providing 2 MB of address space covered by the TLB. Smaller pages give proportionally smaller reaches, limiting the fraction of memory that benefits from fast translation.
Q5. A workload requires 3 GB of memory. The system’s TLB has 256 entries. What minimum page size should be chosen so the TLB reach covers the entire workload?
📖 Explanation: To cover 3 GB with 256 entries, each entry must map at least . The next standard page size exceeding this is 16 MB, which yields a reach of , comfortably covering the workload. A 2 MB page would only give 512 MB reach, far short of 3 GB, while 1 MB and 4 KB are even smaller.
Q6. Why does increasing the number of TLB entries generally improve effective memory access time?
📖 Explanation: More TLB entries mean a higher probability that a virtual‑to‑physical translation is already cached, so the CPU can fetch data without a costly page‑table walk. This directly reduces average memory access time. Increasing entries does not affect page‑fault frequency, CPU frequency, or physical memory size; those are unrelated system attributes.
Q7. How does the choice of page‑replacement algorithm influence the TLB reach of a system?
📖 Explanation: Page‑replacement algorithms decide which resident page to evict when memory is full, but they do not modify the TLB’s structure or the size of pages. Consequently, the TLB reach—defined by entries × page size—remains unchanged regardless of whether FIFO, LRU, or another policy is used. The algorithm impacts overall performance, not the static coverage of the TLB.
Q8. In a demand‑paging environment, what is the primary effect of a high TLB miss rate on system throughput?
📖 Explanation: Each TLB miss forces the processor to walk the page table, which consumes cycles and may trigger a page fault if the needed page is not in memory. These extra delays lower the number of instructions completed per unit time, thus decreasing overall throughput. The other options describe unrelated phenomena: cache coherence, disk bandwidth, and temperature are not direct consequences of TLB misses.
Q9. What is the definition of TLB reach?
📖 Explanation: TLB reach measures how much virtual address space can be accessed with only TLB hits. It is calculated by multiplying the number of entries in the TLB by the size of each page, giving a coverage value such as . It is not simply the count of entries, nor does it refer to physical memory size or lookup delay, which are separate performance metrics.