GATE CS 2024 Set 2 — Question 64
NAT+2 / -0HardMultilevel & Inverted Page TablesMemory ManagementOperating SystemDemand Paging
Operating System → Memory Management → Demand Paging
Last updated
Question
Consider a 32-bit system with 4 KB page size and page table entries of size 4 bytes each. Assume 1 KB = bytes. The OS uses a 2-level page table for memory management, with the page table containing an outer page directory and an inner page table. The OS allocates a page for the outer page directory upon process creation. The OS uses demand paging when allocating memory for the inner page table, i.e., a page of the inner page table is allocated only if it contains at least one valid page table entry.An active process in this system accesses 2000 unique pages during its execution, and none of the pages are swapped out to disk. After it completes the page accesses, let denote the minimum and denote the maximum number of pages across the two levels of the page table of the process.The value of is ________
Correct answer
1028 to 1028
Solution
1.System Parameters:
- Logical Address (LA) space = 32 bits.
- Page Size (PS) = 4 KB = bytes.
- Page Table Entry (PTE) size = 4 bytes.
- Number of entries per page = entries.
- Total pages in LA space = pages.
- The Inner Page Table (IPT) needs to map pages. Since each IPT page holds 1024 entries, the total number of IPT pages is pages.
- The Outer Page Directory (OPD) must have one entry for each of the 1024 IPT pages. Thus, the OPD has 1024 entries.
- Size of OPD = bytes = 4 KB, which fits exactly in 1 page.
- 1 page is always allocated for the OPD upon process creation.
- To minimize the number of IPT pages for 2000 unique pages, we assume they are contiguous in the logical address space.
- Number of IPT pages = pages.
- .
- 1 page is always allocated for the OPD.
- To maximize the number of IPT pages, we spread the 2000 unique pages across as many IPT pages as possible.
- Since there are only 1024 IPT pages in total, and the process accesses unique pages (where ), it is possible to have at least one entry in every single IPT page.
- .
- .
More questions on Memory Management
2024 Set 1 Q24Which of the following statements about threads is/are TRUE?2024 Set 2 Q24Which of the following tasks is/are the responsibility/responsibilities of the memory management…2024 Set 2 Q25Consider a process P running on a CPU. Which one or more of the following events will always…2024 Set 1 Q25Which of the following process state transitions is/are NOT possible?2024 Set 2 Q37Consider a single processor system with four processes A, B, C, and D, represented as given below,…
Practice GATE CS PYQs with adaptive difficulty
Timed practice, skill tracking, and AI explanations — free to start.
Start practicing free