📝 Inverted page tables in Virtual Memory (8 MCQs)
Physical-Frame-Oriented Virtual Address Translation
An inverted page table is a virtual-memory data structure containing one principal entry for each physical frame rather than a complete entry for every possible virtual page. Each entry records the virtual-page identity and process or address-space identifier associated with that frame. The structure reduces page-table storage requirements for systems supporting large virtual address spaces and many processes.
Reducing the Memory Cost of Conventional Page Tables
Conventional page tables can require substantial storage because their entries reflect virtual address ranges, including regions that are not currently mapped. Inverted tables limit their main entry count according to physical frame capacity. However, direct indexing by virtual page number is no longer straightforward, so the operating system needs additional lookup mechanisms to identify the frame associated with a reference.
Searching by Process Identifier and Virtual Page Number
When a virtual address is referenced, the translation mechanism combines its virtual page number with the current address-space identifier. It searches the inverted table, commonly using a hash function, for a matching entry. The identified entry provides the physical frame number. The page offset is then combined with that frame number to form the physical address.
Calculating Entries for a Physical Memory Configuration
Suppose a computer provides 1 GB of physical memory and uses 4 KB frames. Dividing physical memory by frame size gives 262144 frames. The inverted table therefore needs 262144 principal frame entries, regardless of how many total virtual pages the combined processes could potentially address. Additional hash structures or metadata may require further storage.
Reduced Table Size and More Complex Lookup
Inverted page tables substantially reduce mapping-table storage compared with large conventional page tables. Their main limitation is the additional work required to locate a virtual mapping, especially when hashing produces collisions. Shared pages can also complicate reverse mapping because multiple processes may reference common physical contents. TLBs and suitable hash structures help improve translation performance.
Distinguishing Physical Entries from Virtual Pages
'An inverted table contains one entry for every virtual page' is incorrect because its principal entries correspond to physical frames. 'Translation always uses direct virtual indexing' is incorrect because searching or hashing may be necessary. 'One physical frame can never be shared' is incorrect because shared-memory arrangements can associate multiple virtual mappings with common physical contents.
Exam Focus: Entry Counts and Inverted Lookup
Calculate principal table entries by dividing physical memory capacity by frame size. Identify the process identifier and virtual page number required for a matching entry. Compare inverted and conventional page tables in storage overhead and lookup complexity. Explain how hashing and TLB caching improve translation performance and why address-space identifiers distinguish otherwise identical virtual page numbers.
Key Terms of Inverted Page Tables
- Inverted table - One principal entry per physical frame.
- Physical frame - Resident memory block.
- PID - Identifies a process.
- Virtual page number - Identifies a virtual page.
- Reverse mapping - Relates physical frames to mappings.
- Hash lookup - Locates matching translation entries.
📝 All Inverted page tables in Virtual Memory MCQs
Q1. A system uses an inverted page table that stores one entry per physical frame. When a process requests a virtual address, the OS must locate the corresponding frame. Which method is most efficient for finding the frame entry?
📖 Explanation: The hash‑based lookup is efficient because the inverted table has one entry per frame, not per process. Hashing the (PID, page) pair maps directly to a table slot, giving average‑case O(1) time. Scanning the whole table (A) is O(n) and slow, while per‑process tables (C) defeat the purpose of an inverted design. A binary‑search tree (D) would require ordering and still be O(log n), slower than hashing.
Q2. What best describes an inverted page table?
📖 Explanation: An inverted page table contains a single entry for every physical frame, recording which virtual page (identified by process ID and page number) currently occupies that frame. This contrasts with conventional page tables that have an entry per virtual page of each process. Options B, C, and D describe unrelated structures: per‑process page tables, swap‑space mappings, and a dirty‑bit array, respectively.
Q3. Why does an inverted page table typically use less memory than separate conventional page tables for many processes?
📖 Explanation: Because the inverted table has a single entry for each physical frame, the total number of entries equals the number of frames, independent of how many processes exist. Conventional tables allocate an entry for every virtual page of each process, which can explode as the number of processes grows. Compression (B) and flag elimination (C) provide modest savings, and shared‑library reuse (D) is a separate concern.
Q4. A machine has 8 GB of RAM and a page size of 4 KB. How much memory is required to store an inverted page table if each entry occupies 8 bytes?
📖 Explanation: First compute the number of frames: ; ; frames . Multiplying by 8 bytes per entry gives bytes, about 4 MB. Options A, B, and D underestimate or overestimate the size, while C matches the correct calculation.
Q5. How does using a hash function in an inverted page table affect the average lookup time compared with a linear search?
📖 Explanation: Hashing maps the (process ID, page number) directly to a table slot, so on average the OS examines only one or a few entries, giving time. Linear search must inspect each of the entries, resulting in time. Options B and D describe unrelated complexities, and C is false because hashing does improve performance.
Q6. Process P1 and Process P2 both request virtual page 5. In an inverted page table, how is the entry for P2’s request distinguished from P1’s?
📖 Explanation: The inverted table stores entries keyed by both the process identifier and the page number, so P1’s request and P2’s request map to distinct entries even though the virtual page numbers are identical. Sharing the same entry (A) would cause incorrect address translation, and an error (C) or automatic allocation (D) are not part of the lookup mechanism.
Q7. A system suffers a high page‑fault rate. Which combination is most likely to lower the fault rate while keeping memory overhead reasonable?
📖 Explanation: An inverted page table reduces memory overhead, but lookups can be slower. Adding a TLB caches recent translations, bringing average lookup time close to that of conventional tables while preserving the space savings of the inverted design. Option A lacks the speed benefit, C re‑introduces large tables, and D adds hashing complexity without the caching advantage.
Q8. When handling collisions in an inverted page table, why might chaining be preferred over open addressing in a system with many processes but few pages per process?
📖 Explanation: Chaining stores colliding entries in linked lists attached to each bucket, so the table does not need to reserve extra slots for potential collisions. In a workload with many processes (many distinct keys) but few pages per process, collisions are relatively rare, and the overhead of maintaining pointers is minimal. Open addressing would require probing many empty slots, wasting memory and increasing latency. Therefore, chaining offers better space efficiency and comparable lookup speed in this context.