2,306 views
1 votes
1 votes

If I say that the multi-level paging reduces the size of page table needed to implement the virtual address space of a process, then what is the meaning of last lines in the statement :"to implement the virtual address space of a process"

2 Answers

0 votes
0 votes
Page tables are used to translate the virtual addresses seen by the application into physical addresses ( in this way page tables are used to implement the virtual address space of a process; though the entries may not be linearly available in the page table as demand paging does not require all pages to be present in the physical memory at the same time ). Multilevel paging reduces the size of the page table in physical memory.
0 votes
0 votes

Virtual Address Space: It is the range of virtual(logical) addresses for a particular process.

Now, we use paging in order to efficiently allocate memory for every process. But the problem comes when the page table itself is so large that it uses a large amount of physical memory.

Suppose a processor has 32-bit virtual address space and a 4KB page size. This means that,

  • Top 20 bits represent -> page number
  • Virtual address space may contain 220 pages.
  • If each page table entry is 4B, then we need 220 * 4 = 4MB for its page table alone.
  • With several processes running on a machine this is not an ideal situation. That's why we go for multi-level paging. 

 

To solve this, what we can do is, 

  • Split the 20 bits into two(10 bit each).
  • First 10 bit for page table 1 and the next 10 bits for page table 2.
  • The first-page table now points into the second-page table instead of the frame number. And the second-page table now points to the corresponding frame number.
  • Total number of entries in page table 1 = 210 
    • So we have 210  second-level page tables.
    • Size of first-page table = 210 * 4 = 4KB
  • In order to access the page from memory, we only need the first-page table and one of the second-page tables in main memory. So the total size is 4KB + 4KB = 8KB.

Related questions

2 votes
2 votes
0 answers
1
gatejr asked Jun 10, 2016
757 views
Consider, 2 level paging , with Process P, Inner page table PTi, and outer page table PTo.Now we know that P and PTi are divided in various pages but PTo is in 1 page on...
0 votes
0 votes
0 answers
3
ankit3009 asked Jan 12, 2022
376 views
In paging , giving more bits to the innermost table as compared to the outermost page table results in using less physical memory space. Is this statement true always?