edited by
63,938 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
A simple approach to this question:

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
reshown by
0 votes
0 votes

Answer is 1260.

How?

see first the CPU will fetch the instruction:
Here arises 2 cases.
Case I:The instruction is  present in the main memory.
Here for instruction memory accesses will be perforrmed.

for 1 memory access avg access time:

X=TLB hit(TLB access time+memory access time for the word)+TLB miss(TLB access time+memory access for first level of page table+memory access for 2nd level of page table+memory access for the word)

X=0.9(0+150)+0.1(0+150+150+150)=135+45=180ns.
we require 2 memory access/instruction  there fore for each instruction 2X=360ns necessary for memory access.

Case II:The instruction is  not present in the main memory.

then we need

Y=page fault service time +time to access memory 2 times=8 *10^6+2X
 

finally.......

the time required:
The CPU time required per instruction+0.9999(time taken when instruction is present in the memory)+0.0001(time taken when instruction is not persent in the memory).

100ns+0.9999(2X)+0.0001(8 *10^6+2X)=1260ns


 

 


 


 



 

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

 

Answer:

Related questions

66 votes
66 votes
9 answers
11
Kathleen asked Sep 18, 2014
23,929 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
12
go_editor asked Apr 24, 2016
19,716 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
13
52 votes
52 votes
10 answers
14