🎓 BookMCQ
← Back to 9. Virtual Memory

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

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

A.Scan the entire table sequentially ✅
B.Apply a hash function to the (process‑ID, page‑number) pair
C.Maintain a separate per‑process page table
D.Use a binary‑search tree keyed by virtual page numbers
💡 Difficulty: easy | ✅ Correct: A

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

A.A table with one entry for each physical frame ✅
B.A table with one entry for each virtual page of every process
C.A table that maps processes directly to swap space
D.A table that stores only dirty bits for pages
💡 Difficulty: easy | ✅ Correct: A

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

A.It stores one entry per physical frame rather than per virtual page
B.It compresses page numbers into shorter codes ✅
C.It eliminates the need for valid‑bit flags
D.It reuses entries for shared libraries
💡 Difficulty: medium | ✅ Correct: B

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

A.Approximately 1 MB
B.Approximately 2 MB
C.Approximately 4 MB ✅
D.Approximately 8 MB
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: First compute the number of frames: 8 GB=8×230 bytes8\text{ GB}=8\times2^{30}\text{ bytes}; 4 KB=212 bytes4\text{ KB}=2^{12}\text{ bytes}; frames =230+3−12=219=524,288=2^{30+3-12}=2^{19}=524{,}288. Multiplying by 8 bytes per entry gives 524,288×8=4,194,304524{,}288\times8=4{,}194{,}304 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?

A.It changes the lookup from O(n)O(n) to average‑case O(1)O(1) ✅
B.It changes the lookup from O(n)O(n) to O(log⁡n)O(\log n)
C.It has no effect on lookup time
D.It makes lookup slower than linear search
💡 Difficulty: medium | ✅ Correct: A

📖 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 O(1)O(1) time. Linear search must inspect each of the nn entries, resulting in O(n)O(n) 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?

A.Both share the same table entry ✅
B.Each process has a separate entry identified by its process ID
C.The OS raises an error because the page is already mapped
D.A new physical frame is allocated automatically
💡 Difficulty: medium | ✅ Correct: A

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

A.Switch to an inverted page table without any cache ✅
B.Use an inverted page table together with a translation look‑aside buffer (TLB)
C.Replace the inverted page table with a conventional table and increase page size
D.Adopt an inverted page table with double‑hashing but no TLB
💡 Difficulty: hard | ✅ Correct: A

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

A.Chaining uses less memory than open addressing
B.Chaining allows variable‑length lists, reducing wasted slots ✅
C.Open addressing provides faster lookups in this scenario
D.Both methods perform identically, so choice is irrelevant
💡 Difficulty: hard | ✅ Correct: B

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

🔗 Related Topics (MCQs)