1,515 views
0 0 votes

On a system using demand paging, it takes 200 ns to satisfy a memory request if the page is in memory. If the page is not in memory, the request takes 7 ms if a free frame is available or the page to be replaces is not modified. It takes 15 ms if the replaced page is modified. What is the effective access time if the page fault rate is 5% and 60% of the time the page to be replaced has been modified?

  1. 600.19 micro seconds
  2. 590.19 micro seconds
  3. 790.19 micro seconds
  4. none

1 Answer

0 0 votes

Concept : 

Firstly, CPU will generate logical address of the page and using this address searching in page table present in main memory to get physical frame number of page is done and then page will be accessed from main memory which will take $T_{mm}$=200ns (as given in question.)

if page is not present in Main memory then it means page fault occurs and hence Page Fault Service will be done and page will be brought from secondary memory to Main-Memory. 

Now if any Main-Memory frame is free where this page can be copied it will be directly copied, but if all frames are occupied by other pages then a page replacement algorithm will run and it will select 1 page which will be removed from MM Frame so that the page requested by CPU can come inside MM.

Now suppose a page is chosen to be replaced then there are two possibilities :

(i) the page that is going out of MM is not modified that means no write operation performed in it hence it will be directly overwritten by page that CPU requested and it will take $T_{not-modified}$ = 7ms.(as given in question.)

(ii) the page that is going out of MM is  modified that means write operation performed in it hence it will be firsly moved to hard disk then our requested page will come in this frame and it will take $T_{modified}$ = 15ms.(as given in question.)

also given that,

 page fault rate (P) is 5% =0.05 and hence,

(1-P)= when page fault not there =0.95

Modified pages (M) is 60% =0.6  and hence,

(1-M) = when page is not modified =0.4

Now,

Effective Memory Access Time = (1-P)*($T_{mm}$​​​​​​​)  +  P[ (1-M)*($T_{not-modified}$)  +  M*$T_{modified}$ ]

= (0.95*200ns) + 0.05[ (0.4*7ms)+(0.6*15ms)]

=(190ns)+ 0.05(2.8ms+9ms)

=(190ns)+0.05(11.8ms)

convert all to microseconds

=(0.19microseconds)+0.05(11800microseconds)

=(0.19+590)

=590.19 micro seconds

So option b) is correct.

 

 

 

 

 

Position:
Show:

Related questions

0 0 votes
1 1 answer
1.2k
1.2k views
none30 asked Jul 1, 2023
1,231 views
On a system using demand - paged memory, it takes 120 ns to satisfy a memory request if the page is in memory. If the page is not in memory, the request takes 5 ms. What ...
1 1 vote
1 1 answer
83
83 views
GO Classes asked Aug 13
83 views
Suppose a $32K \times 8K$ matrix $A$ with $1$-byte elements is stored in row-major order in virtual memory.Assume:Only this program occupies physical memory. The matrix b...
2 2 votes
2 2 answers
122
122 views
GO Classes asked Aug 11
122 views
An operating system can use page tables and exceptions to perform allocation on demand, where it does not allocate physical memory for a program until the program tries t...
0 0 votes
1 1 answer
2.1k
2.1k views
kauray asked Dec 20, 2017
2,065 views
In a demand-paged system, it takes 100 nanoseconds to access memory. The page table has 8 entries and is held in registers. It takes 10 milliseconds to service a page fau...