Skip to content
GATEiit

GATE CSE 2024 Session 2 Q64: Min and max page-table pages for 2000 pages in a 2-level table

Question

Consider a 32-bit system with 4 KB page size and page table entries of size 4 bytes each. Assume 1 KB = 2102^{10} 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 X denote the minimum and Y denote the maximum number of pages across the two levels of the page table of the process.

The value of X+Y is ________

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 1028 (official GATE 2024 final answer key)

Concept used: Each inner page-table page holds 1024 entries; the outer directory has 1024 entries.

First step: Minimum: pack 2000 pages into as few inner pages as possible; maximum: spread them so each inner page holds one, limited by the 1024 directory entries.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2024 Session 2 CS question paper and final answer key, organised by IISc Bangalore. Question paper · Answer key