480 views
0 votes
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

2 Answers

0 votes
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.

 

 

 

 

 

0 votes
0 votes
Given details:-

Page fault rate = 0.0.5

Prob. of replaced page being dirty = 0.6

Time takes to satisfy the memory request if page is in memory ( that is checking tlb , if its not in tlb checking in page table then getting the data at the location) = 200ns = 200 * 10^-9 seconds  = A

Time takes to satisfy the memory request if its page fault and its not dirty = 7 * 10^-3 seconds = B

Time takes to satisfy the memory request if its page fault and its dirty = 15 * 10^-3 seconds= C

 

EMAT = (1 – page fault rate ) [ A ]  + page fault rate [ 0.4 ( B)  + 0.6( C )  ]

          = 0.95( 200 * 10^-9 seconds )     + 0.05( 0.4( 7 * 10^-3 ) + 0.6 ( 15* 10^-3 )  )

          =0.00059019seconds

          =590.19 micro seconds.

Related questions

0 votes
0 votes
1 answer
1