🎓 BookMCQ
← Back to 8. Main Memory

📝 Inverted page tables (11 MCQs)

📖 From Operating System • 8. Main Memory • 11 questions available

What is Inverted page tables?

Definition:
Inverted page tables maintain one entry per physical frame storing owning process ID and VPN reversing traditional mapping to save memory in large systems.

Example:
Frame f=500f=500 entry contains PID=3,VPN=120\langle PID=3, VPN=120 \rangle; search scans table or uses hash to find match translating 3,120f=500\langle 3,120 \rangle \to f=500.

Reason:
Memory usage depends on physical RAM not virtual address space making it ideal for systems with vast virtual spaces but limited physical memory.

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)=(PIDVPN)mod220h(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/(10.7)=3.331/(1-α)=1/(1-0.7)=3.33. However, with a good hash function and chaining, the expected probes are about 1+α/21+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×5bytes=5MiB2^{20}×5 bytes =5 MiB. However, practical implementations align to 8‑byte boundaries, giving 220×8bytes=8MiB2^{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)