retagged by
590 views
0 votes
0 votes
Why do we need multilevel paging?

According to me the reason is that page table needs contiguous memory allocation.So if page table size is too large, we may not be able to store the table in contiguous memory.

So is this the reason behind multilevel paging?

Also when we page the page table, do we store all levels page table in memory or only the outer level page table?
retagged by

1 Answer

1 votes
1 votes
From OSTEP,

"Let’s start out with a linear page table. As you might recall1 , linear page tables get pretty big. Assume again a 32-bit address space ($2^{32}$ bytes), with 4 KB ($2^{12}$ byte) pages and a 4-byte page-table entry. An address space thus has roughly one million virtual pages in it ( $2^{32}/ 2^{12}$ ); multiply by the page-table entry size and you see that our page table is 4MB in size. Recall also: we usually have one page table for every process in the system! With a hundred active processes (not uncommon on a modern system), we will be allocating hundreds of megabytes of memory just for page tables!"

Continued:

"The basic idea behind a multi-level page table is simple. First, chop up the page table into page-sized units; then, if an entire page of page-table entries (PTEs) is invalid, don’t allocate that page of the page table at all. To track whether a page of the page table is valid (and if valid, where it is in memory), use a new structure, called the page directory. The page directory thus either can be used to tell you where a page of the page table is, or that the entire page of the page table contains no valid pages"

Related questions

0 votes
0 votes
2 answers
1
Unique_999 asked Aug 17, 2023
293 views
Can Any explain the relationship between The “ Word Size “ and “ Logical Address Space “
1 votes
1 votes
2 answers
2
Aks9639 asked Sep 10, 2018
1,406 views
Consider a system using 2 level paging applicable page table is devided into 2k pages each size 4kB. If PAS is 64 MB which is devided into 16K frames . PTE size is 2B in...
2 votes
2 votes
2 answers
3
amIndian asked Dec 30, 2017
855 views
A system support 32 bit virtual address with a page size of power of 2. Page table entries 32 bit wide. The page size in KB of the system should be ____ in order to make ...
0 votes
0 votes
0 answers
4
SSR17 asked Feb 8
188 views
we have 8 pages (each side 32B) to store in physical memory of 2^32 bits how many bits are required to identify each page , according to me 3 bits are required but that i...