📝 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 entry contains ; search scans table or uses hash to find match translating .
Reason:
Memory usage depends on physical RAM not virtual address space making it ideal for systems with vast virtual spaces but limited physical memory.
📝 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.