📝 Inverted page tables (11 MCQs)
One Page-Table Entry for Each Physical Frame
An inverted page table is a memory-management structure that maintains one entry for each physical frame rather than keeping a complete page-table entry for every virtual page of every process. Each entry records the virtual-page information and process or address-space identifier associated with that frame. This organisation substantially reduces page-table storage when processes have large virtual address spaces.
Reducing the Storage Cost of Conventional Page Tables
Conventional per-process page tables can become large because their structure reflects virtual address ranges rather than only the physical memory currently occupied. Systems with large address spaces and limited physical RAM may therefore spend considerable memory storing mapping information. Inverted tables address this problem by making the number of entries proportional to physical frames, although locating a mapping becomes more complicated.
Searching Entries with Process and Virtual Page Identifiers
For a virtual memory reference, the translation mechanism identifies the process or address-space identifier and virtual page number. A search structure, often using hashing, locates the inverted-table entry containing the matching pair. That entry identifies the physical frame. The page offset is then combined with the frame number to produce the physical address. TLB caching avoids repeated searches for recent translations.
Calculating the Number of Inverted Table Entries
Suppose a computer has 1 GB of physical memory and uses 4 KB frames. Dividing 1 GB by 4 KB gives 262144 physical frames, so the inverted page table requires 262144 entries. This count depends on physical frame capacity rather than the combined virtual address spaces of all processes, illustrating the storage advantage of the inverted organisation.
Smaller Tables and More Complex Translation Searches
Inverted page tables substantially reduce mapping-table storage compared with large conventional page tables. Their main limitation is the additional work required to locate an entry for a virtual address, especially when hashing produces collisions. Shared virtual pages also complicate reverse mapping because multiple processes may reference the same physical frame. TLBs and suitable lookup structures improve translation performance.
Clarifying Physical Entries and Virtual Address Ownership
'An inverted table contains one entry for every virtual page' is incorrect because entries correspond to physical frames. 'The physical frame number must be found by direct virtual indexing' is incorrect because translation requires searching or hashing process and page identifiers. 'One physical frame can never be shared' is incorrect because shared-memory arrangements can associate multiple virtual mappings with common physical contents.
Exam Focus: Frame Counts and Reverse Mapping
Calculate inverted-table entries by dividing physical memory capacity by frame size. Identify the process identifier and virtual page number required for a matching entry. Compare the storage requirements of inverted and conventional page tables, and explain why hashing and TLB caching improve lookup performance. Consider how shared pages affect mappings and why address-space identifiers are necessary.
Key Terms of Inverted Page Tables
- Inverted table - One entry per physical frame.
- Physical frame - Resident memory block.
- PID - Identifies a process.
- Virtual page number - Identifies a process page.
- Reverse mapping - Relates frames to virtual pages.
- Hash lookup - Locates matching mapping entries.
📝 All Inverted page tables MCQs
Q1. What is an inverted page table in virtual memory systems?
📖 Explanation: The correct answer is A because an inverted page table keeps a single entry for each physical frame, recording which process and which virtual page occupy that frame. Option B describes a conventional page table that has one entry per virtual page, not per frame. Option C confuses the table with a page cache, and option D mixes up mapping to disk blocks. Understanding this definition helps OS designers choose the right structure for large memories where per‑process tables would be huge.
Q2. Which advantage does an inverted page table provide over a conventional per‑process page table?
📖 Explanation: Option D is correct because an inverted page table stores a single entry per physical frame, so when several processes share the same page the entry is not duplicated, saving space. Option A is also true but not the most distinctive advantage in this context. Options B and C are false: address translation is still required, and virtual address limits remain unchanged. Recognizing this benefit explains why many modern OSes prefer inverted tables for systems with many processes.
Q3. A system has 8 GB of physical memory with a 4 KB page size. How many entries does the inverted page table contain?
📖 Explanation: The number of frames equals physical memory divided by page size: bytes, bytes, so frames = . Therefore the inverted page table has that many entries, making B correct. Option A is half that value, C is double, and D is four times larger, all resulting from mis‑calculating the division. Knowing the exact entry count is crucial for sizing the table in real OS implementations.
Q4. How does an inverted page table translate a virtual address to a physical address?
📖 Explanation: The correct answer is C because the translation typically involves a two‑step approach: the OS uses a per‑process directory or segment table to compute a hash key, then accesses the inverted table to retrieve the frame number. Option A would be extremely slow, option B omits the necessary directory step, and option D is impossible since the CPU does not retain the physical address of every memory reference. This two‑level method reflects actual OS designs that balance speed and memory use.
Q5. Process P generates a virtual address that causes a page fault. Which sequence correctly describes how the inverted page table is consulted?
📖 Explanation: When a page fault occurs, the OS must locate or create an entry in the inverted table. The correct process is D: the OS adds a new entry after ensuring the page is not already present, because the inverted table may already contain a shared copy. Option A would be too slow, option B describes a typical hash‑probe but misses the fault handling step, and option C is inaccurate about reloading the whole table. This reflects real OS behavior where fault handling updates the table efficiently.
Q6. Two processes share the same read‑only library code. How does an inverted page table represent this sharing?
📖 Explanation: Option B is correct because the inverted table can keep one entry per frame and maintain a reference list of all processes that map to that frame, enabling sharing without extra memory. Option A would waste memory, option C is unnecessary for read‑only sharing, and option D would cause a fault. This mechanism is used in real operating systems to efficiently share libraries among many applications.
Q7. What is a primary drawback of using a hash‑based inverted page table?
📖 Explanation: The main issue is C: implementing a good hash function often needs extra hardware or complex software, increasing cost. Option A is false because collisions are inherent to hashing; option B describes a real performance problem but is not the primary drawback—performance can be mitigated. Option D is incorrect because hash tables can handle shared pages. Recognizing hardware cost helps students evaluate trade‑offs when designing memory management units.
Q8. If a system with 2^20 physical frames uses a simple modulo hash function , what is the expected average number of probes for a successful lookup when the table is 70% full?
📖 Explanation: When a hash table is 70% full, the average successful probe count for linear probing is approximately . However, with a good hash function and chaining, the expected probes are about . The closest answer is 1.7 probes, reflecting a realistic overhead after accounting for imperfect hashing. Options A and C are too low or high, and D overestimates. This calculation mirrors real OS performance analysis of inverted tables.
Q9. A machine has 2^20 frames and supports up to 2^16 processes. Estimate the memory needed for an inverted page table that stores a 16‑bit PID and a 20‑bit frame number per entry, ignoring overhead for collision handling.
📖 Explanation: Each entry holds 16 bits (PID) + 20 bits (frame) = 36 bits ≈ 5 bytes (rounded up). With 2^20 entries, memory ≈ . However, practical implementations align to 8‑byte boundaries, giving . The closest listed size is 256 MiB, which assumes 32‑bit entries (4 bytes) plus overhead, indicating a common design choice. Options A, B, and D are far from realistic estimates, making C the best match.
Q10. Which statement best describes the relationship between inverted page tables and hierarchical (multi‑level) page tables?
📖 Explanation: Option C is correct because hierarchical tables aim to speed up translation by breaking the virtual address into levels, while inverted tables aim to cut memory consumption by having one entry per physical frame. Option A misstates the entry granularity, option B ignores the distinct lookup mechanisms, and option D reverses the sharing capabilities. Understanding this contrast helps students choose the appropriate scheme for a given system.
Q11. To support variable‑size pages in an inverted page table, which modification is most essential?
📖 Explanation: The crucial change is B: each entry must record the size of the page it represents, allowing the OS to calculate offsets correctly for variable‑size pages. Option A adds unnecessary indirection, option C would fragment the table and complicate management, and option D would lose process identification, breaking isolation. This adjustment mirrors real OS extensions that enable flexible page sizing while preserving the benefits of an inverted table.