GATE / CS ARCHIVE

GATE CSE 2021 SET 2 / QUESTION 48

GATE CSE 2021 Set 2 Q48

Operating Systems · Virtual Memory & Paging · Full GATE CSE 2021 Set 2 paper

GATE 2021 Set 2, Q48 2 marks · NAT
Report issue

Virtual Memory & Paging

Question 48, GATE 2021: 39-bit virtual address splits as 9-bit level1,9-bit level2,9-bit level3,12-bit offset. Pages are 4KB and all PTEs 8 bytes. Process maps 2GB virtual to 2GB physical. Find minimum total page-table memory in KB, with binary KB/GB.
Tap to enlarge
Answer & solution

Official answer: 4108

Each page-table page holds 4096/8=512 entries. The2GB mapping needs 231/212=219 leaf entries, hence 1024 level3 pages. Packing these contiguously minimizes higher levels: 1024/512=2 level2 pages and one level1 root page. Total=(1024+2+1)*4KB=4108KB. This is the minimum with allocated whole page-table pages and a densely placed virtual mapping.

Each level-2 page indexes up to 512 level-3 pages, which collectively map 512×512×4KB=1GB. Thus the 2GB region can occupy two such subtrees under one root. Sparse placement could require more page-table pages; the word minimum permits contiguous, suitably aligned placement. Physical page contents consume 2GB but are not part of page-table overhead.

Original paper, page 85 · Answer key