1,712 views
1 votes
1 votes

Processor:- 32 bit with 4 KB page size.

RAM: - 4 GB with 220 frames in the RAM.

Process:-

> Process Name - MOTO GP 

> Process Size -  1GB

> Frame Size - 4 KB // As frame size is always equal to page size.

> Number of pages - 218 Pages

Now, when I double click on the short cut icon of MOTO GP on the desktop it will invoke the process and load it into the main memory. It will require 1GB of space in RAM. As we are using the concept of paging the page table of the process MOTO GP will be created in the RAM itself.

Specification of Page Table:-

> Number of entries in page table - 218 

> Page table entry size - 20bit // I am not considering other required bits like a valid-invalid bit, modified bit, etc.

> Content of page table - frame number of 20 bits, thus page table entry size is 20 bit.

> Page Table Size = No of pages * PTE size.

218*20 bit= 5120 Kbit = 640 KB.

So, this process consumed in total 1 GB + 640 KB space in memory,

Now, 

Q1> from here I want to use the concept of Multi level paging, how we will do that?

Q2> We will have 4 KB of block size in Cache memory also (True or False) // Concept of CO

Q3> While executing the process if any miss occurs in cache it will fetch the entire block of 4 KB from RAM and therefore the concept of Locality of Reference will be introduced here (True or False)

Q4> Now I have read the concept of Page Fault how it will be related here as all the pages of the process(MOTO GP) have already been in the RAM?

Q5> After allocating space we are left with space less than 3GB, which is not sufficient for other processes like NFS Shift 2 which is approx of 7 GB, I think which introduces the concept of virtual memory but don't know how?

1 Answer

1 votes
1 votes
Q1)Consider single level paging

VA= 32 bit, Page size = 4Kb

Number of bits required for page number $\frac{2^{32}}{2^{12}}=2^{20}$

Size of Virtual Memory = $2^{20}*20$= 20 MB

Consider 2 level page: 10:10:12

2nd level will have $\frac{2^{18}}{2^{10}}=2^{8}$ page table each having 2$^{20}$ entries

corresponding to it  1st level will have single page table

Size of Virtual memory= $2^{10}*20+2^{8}*2^{10}*20$ = 5 MB approx

3 level paging 6|7|7|12

3 rd level will have $2^{11}$, 2nd level will have$2^{4}$ 1st level will have single page table

Size of Virtual memory = ($2^{6}+2^{4}*2^{7}+2^{11}*2^{7}$)*20= 5Mb approx

so 3 level paging has no effect on size of virtual memory hence 2 level paging can be used

Q2) Main memory block size = cache block size hence 4KB

Q3) Yes system will use locality of reference because of 4kb block size

Q4) If no other process is in main memory then no page fault

Q 5) for NFS now both moto amd nfs can have swapping and swap out depending on their peak demand and avaiable memory at that time

Related questions

1 votes
1 votes
2 answers
2
ajayraho asked Oct 29, 2022
634 views
Is the page table entry size same for each entry in page tables of all levels in multilevel paging?
0 votes
0 votes
1 answer
4
Markzuck asked Dec 22, 2018
1,326 views
for memory overhead in Multi level paging, for innermost table only 1 page size shall be counted na? and NOT the complete page table size?please explain the concept, than...