0
$\begingroup$

I am practicing paging in virtual memory and came across a question with the following details

  • 44-bit address space
  • 16KB page size
  • 16 Bytes Page table entry (PTE)

If I understand paging correctly then there would be 2^30 pages, and the page table size if 2^44 bytes

My questions is, do I use a single-level page table or do I have to go with multi-level and why?

$\endgroup$
1
  • $\begingroup$ Please add to your question: How did you determine total page table size? What would force you to use multilevel page tables? $\endgroup$
    – greybeard
    Commented Jan 23 at 16:46

1 Answer 1

-1
$\begingroup$

Yeah, you probably do. The total size of the page table is $2^{30}\cdot2^4=2^{34} = 16GB$. Clearly prohibitively large. A better arrangement would be a three-level page table, where each level maps ten bits of the virtual address. Since each entry is 16 bytes, the size of a page table for one level is $2^4\cdot2^{10} = 16KB$ which neatly fits into one 16KB page.

$\endgroup$
3
  • $\begingroup$ 16GB is a decent chunk of memory, but is it really prohibitively large? To me it looks more like an odd choice, but possible. $\endgroup$
    – user555045
    Commented Jan 23 at 18:22
  • $\begingroup$ Also multiply the figure by the number of processes running on the system. $\endgroup$ Commented Jan 23 at 18:32
  • $\begingroup$ Still possible, just weird $\endgroup$
    – user555045
    Commented Jan 23 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.