🎓 BookMCQ
← Back to 8. Main Memory

📝 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.
2
Easy
5
Medium
4
Hard

📝 All Inverted page tables MCQs

Q1. What is an inverted page table in virtual memory systems?

A.A table that stores one entry per physical frame, containing the owning process ID and virtual page number ✅
B.A table that stores one entry per virtual page, containing the physical frame number
C.A cache that holds recently accessed pages for faster lookup
D.A structure that maps process IDs directly to disk blocks
💡 Difficulty: easy | ✅ Correct: A

📖 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?

A.Reduces memory overhead by having one entry per physical frame
B.Eliminates the need for address translation entirely
C.Allows each process to have unlimited virtual address space
D.Eliminates duplicate entries for shared pages ✅
💡 Difficulty: easy | ✅ Correct: D

📖 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?

A.1048576 ✅
B.2097152
C.4194304
D.8388608
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The number of frames equals physical memory divided by page size: 8GB=8×2308\text{GB}=8\times2^{30} bytes, 4KB=4×2104\text{KB}=4\times2^{10} bytes, so frames = (8/4)×220=2×220=221=2,097,152(8/4)\times2^{20}=2\times2^{20}=2^{21}=2,097,152. 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?

A.It searches every entry sequentially until a matching process ID and virtual page are found
B.It uses a hash of the (process ID, virtual page) pair to locate the entry directly
C.It first consults a per‑process page directory, then looks up the physical frame in the inverted table ✅
D.It bypasses translation because the physical address is stored directly in the CPU registers
💡 Difficulty: medium | ✅ Correct: C

📖 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?

A.The OS scans the entire table, then updates the TLB after finding the entry ✅
B.The hardware hashes (P, VPN) to an index, probes the entry, and on a miss follows a collision chain
C.The CPU raises an interrupt, the OS reloads the entire table into cache, then retries the instruction
D.The OS creates a new entry without checking for existing duplicates, assuming the page is unique
💡 Difficulty: medium | ✅ Correct: A

📖 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?

A.It creates two separate entries, one for each process, each pointing to the same physical frame
B.It stores a single entry with a list of process IDs that reference the frame ✅
C.It duplicates the library code in physical memory for each process
D.It marks the page as invalid for one of the processes to prevent duplication
💡 Difficulty: medium | ✅ Correct: B

📖 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?

A.Hashing eliminates the need for any collision handling, simplifying design ✅
B.Collisions can cause long probe sequences, degrading lookup performance
C.The hash function requires additional hardware that is costly to implement
D.Hash tables cannot represent shared pages across processes
💡 Difficulty: medium | ✅ Correct: A

📖 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 h(PID,VPN)=(PID⊕VPN) mod 220h(PID,VPN)= (PID\oplus VPN) \bmod 2^{20}, what is the expected average number of probes for a successful lookup when the table is 70% full?

A.1.3 probes
B.1.7 probes ✅
C.2.0 probes
D.2.4 probes
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: When a hash table is 70% full, the average successful probe count for linear probing is approximately 1/(1−α)=1/(1−0.7)=3.331/(1-α)=1/(1-0.7)=3.33. However, with a good hash function and chaining, the expected probes are about 1+α/2≈1+0.35=1.351+α/2≈1+0.35=1.35. 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.

A.64 MiB
B.128 MiB
C.256 MiB ✅
D.512 MiB
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: Each entry holds 16 bits (PID) + 20 bits (frame) = 36 bits ≈ 5 bytes (rounded up). With 2^20 entries, memory ≈ 220×5 bytes=5 MiB2^{20}×5 bytes =5 MiB. However, practical implementations align to 8‑byte boundaries, giving 220×8 bytes=8 MiB2^{20}×8 bytes =8 MiB. 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?

A.Both structures store one entry per virtual page, but hierarchical tables add extra levels for compression
B.Inverted tables replace the need for hierarchical tables by using a single global structure
C.Hierarchical tables reduce lookup time while inverted tables reduce memory usage; they address different design goals ✅
D.Hierarchical tables cannot represent shared pages, whereas inverted tables can only represent private pages
💡 Difficulty: hard | ✅ Correct: C

📖 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?

A.Replace the fixed‑size entry with a pointer to a separate page‑size descriptor table ✅
B.Add a field that records the page size for each entry
C.Store multiple entries per frame to represent fragments of different sized pages
D.Eliminate the PID field and use only virtual page numbers for lookup
💡 Difficulty: hard | ✅ Correct: A

📖 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.

🔗 Related Topics (MCQs)