edited by
63,919 views
129 votes
129 votes

Consider a system with a two-level paging scheme in which a regular memory access takes $150$ $nanoseconds$, and servicing a page fault takes $8$ $milliseconds$. An average instruction takes $100$ nanoseconds of CPU time, and two memory accesses. The TLB hit ratio is $90$%, and the page fault rate is one in every $10,000$ instructions. What is the effective average instruction execution time?

  1. $\text{645 nanoseconds}$
  2. $\text{1050 nanoseconds}$
  3. $\text{1215 nanoseconds}$
  4. $\text{1230 nanoseconds}$
edited by

19 Answers

0 votes
0 votes

I was also confused by this question and was not able to understand as per the concepts that I have understood so far, after struggling it with some time (a-lot of time) I was able to break it down to pieces and was able to come to logical explanation, hope it will be helpful to fellow aspirant.

 

Please refer the the snapshot attached.

 

Solution

 

 

0 votes
0 votes

I was also confused by this question and was not able to understand as per the concepts that I have understood so far, after struggling it with some time (a-lot of time) I was able to break it down to pieces and was able to come to logical explanation, hope it will be helpful to fellow aspirant.

 

Please refer the the snapshot attached.

 

Solution

 

0 votes
0 votes
We can approach this question as follows:

1. TLB hit:

      1.1 no page fault : access the instruction

      1.2 page fault : service the page fault

 

2. TLB miss:

 Access 2 levels of paging and then:

     2.1 no page fault : access the instruction

      2.2 page fault : service the page fault

so, average instruction execution time =

$0.9[0 + 0.0001(8*10^6) + 0.9999(400)] + 0.1[0 + 300 + 0.0001(8*10^6) + 0.9999(400)] = 1229.96 ns$

instruction execution time = 100ns + 2[150ns] = 400ns
0 votes
0 votes
we know the formula

EMAT = px(page fault service time) + (1-p)x memory access time

now , p = 1/10000  , (1-p) = (1- 1/10000)

          page fault service time = 8 milliseconds  ,

now we left with memory access time , the instruction requires CPU time of 100 ns , and TLB hit ratio is given as 90% which shows the use of TLB . and we know if we got a hit in TLB then we directly fetch from memory , that’s why it is specified regular memory access takes 150 seconds

1 memory access time =  [  TLB access time ]

                                    =  [ 0.9 x( 150) + 0.1 ( 150+150) ]  = 165 ns

 therefore 2 memory acess time takes 2 x 165

so now  average instruction execution time  =

CPU time + EMAT  = 100 + [ 1/10000 x(8 ms) + (1-1/10000) x 2 x 165]

                                                                                                           = 1230 ns
Answer:

Related questions

66 votes
66 votes
9 answers
1
Kathleen asked Sep 18, 2014
23,925 views
The minimum number of page frames that must be allocated to a running process in a virtual memory environment is determined bythe instruction set architecturepage sizenum...
59 votes
59 votes
4 answers
2
go_editor asked Apr 24, 2016
19,714 views
Consider the following program segment for a hypothetical CPU having three user registers $R_1, R_2$ and $R_3.$\begin{array}{|l|l|c|} \hline \text {Instruction} & \text...
35 votes
35 votes
3 answers
3
52 votes
52 votes
10 answers
4