578 views
In a paged memory, the page hit ratio is $0.35$. The time required to service the page fault is $100$ ns. Time required to access a page in primary memory is $10$ ns.

The average time required to access a page is ________ ns

Page access time=
(1-page fault)*(Time required to access a page in primary memory) + (page fault) * Miss penalty

We assume page access is Simultaneous !

page fault rate is (1- hit ratio) = 1- 0.35 = 0.65

Time required to access a page in primary memory is 10 ns as given .

Time to access page in primary memory  ( Tp) =  (1- 0.65)  * 10 = 0.35 * 10 = 3.5 ns.

Time required to access page in secondary memory is the Miss penalty time which is  100 ns as given .
Miss ratio =(1- 0.35)=0.65

Missed pages will be found  in secondary memory.

Time to access page in secondary memory ( Ts)   =  Miss ratio * time for secondary memory
=(1-0.35)*100
=65.0ns

Average time required to access a page is
= Ts+Tp

=65.0ns+3.5ns

=68.5ns

PS :

Read this comment to make everything clear : https://gateoverflow.in/96884/operating-systems-2-29#c125175

by

Thank you so much Bikram sir.

Update

After discussing with Bikram Sir , this what we could conclude -

1) Simultaneous and Hierarchical access is related only when dealing between Cache memory and Main memory, where

a) Write Back meant writing on the cache and only when a block has to be replaced in the cache we write      back the contents of that block to the main memory thus making it a Hierarchical access  and

b) Write Through meant writing onto the cache and main memory simultaneously whenever the contents          are modified making it simultaneous access.

2) When dealing with Primary memory and Secondary Memory , there is no specific thing as simultaneous and hierarchical access.

The general procedure goes this way -

Suppose we want a page called Page X which is not in the Main memory, the following things will happen  -

1) Page Table (assuming there is one) will search for Page X and wont find any, this will lead to Page Fault.

2) This will begin the Page Fault Service Time  where the it will access the Secondary memory for Page X and once found will load it into the Primary memory and update the page table.

3) Now we will access the Primary memory knowing it is loaded into the Primary memory successfully.

Now , in the above question it was earlier stated that -

" The time required to access page in secondary memory is 100 ns. " , then the Page Fault Service Time  would be 100 + 10 = 110 ns

Now , after being rephrased to -

" The time required to service the page fault is 100 ns. " , then Page Fault Service Time would be  100 ns ( as it includes everything)

Thanks much @Harsh , i am grateful to you as always :)

just one comment in your note to make it more clear :

in last line you said , as it includes everything .. where everything means Accessing the page in secondary memory + Loading the page in main memory + Accessing the page in Main memory = 100 ns .

Here that 100 ns is for service the page fault time given in the question .
0.35 ( 10 + 10 ) + 0.65( 10 + 100) = 78.5

Effective Access Time := (TLB_search_time + 2*memory_access_time) * (1- hit_ratio) +
(TLB_search_time + memory_access_time) * hit_ratio

but this question we need average  time require to access a page .

oohh , i got it. I was thinking of effective address time but the question is for average. Thank you sir
sir , as u said ...

and for second case there is a miss means page is not found in primary memory and we have to look for secondary memory so why to search for again in primary memory ?

But how it will know that page is not available in primary storahe for that it need to search i primary memory .

In fact for each page access we need to look in primary storage . out of which 35 time we will get the the page in primary storage and 65 time we didnt get in primary memory so need to search in secodary.
$0.65(100ns)+0.35(10ns)=65ns+3.5ns=68.5ns$