Subjects Subjects About Login

OS : 2004 GATE Questions

Questions : 1


QID : 311GATE-2004, 2M

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?

Options:
A) 645 nanoseconds
B) 1050 nanoseconds
C) 1215 nanoseconds
D) 1230 nanoseconds
Ans : Option D
Solution :
Main Memory Access Time = m = 150 ns

Time for One Instruction = i = 100 ns + 2 mem accesses
= 100ns + 2*150 ns
= 400 ns

TLB Hit Ratio = 90%
so, out of 10,000 instructions, TLB is missed 1000 times
TLB access time is not given, consider its ZERO

Page Fault Rate = 1/10000
So, out of 10,000 instructions, only for 1 instruction page fault occurs.
Page Fault Service time = 8ms = 8000,000 ns


Lets calculate Total Execution time for all 10,000 instructions including TLB and Page Fault overhead.

Total Time = Actual Instruction Time
+ Overhead when TLB is missed
+ Overhead when Page fault

= [10,000 * 400 ]
+ [1000 * 300] (because its 2 level paging, its TLB + 2m)
+ [1 * 8000000]

= 1230,0000 ns

So, Average = 1230,0000 / 10,000
= 1230 ns
 

Have a Question?


Submit Here

Previous GATE Papers


Year Key Organized by
2019 Key IIT Madras
2018 Key IIT Guwahati
2017(Set1) Key IIT Roorkee
2017(Set2) Key IIT Roorkee
2016(Set1) Key IISc
2016(Set2) Key IISc
Show All