The GATE Grind

GATE 2018 CS – Question 20

Operating System · Memory Management and Virtual Memory · 1 mark · Multiple choice

Consider a process executing on an operating system that uses demand paging. The average time for a memory access in the system is $M$ units if the corresponding memory page is available in memory, and $D$ units if the memory access causes a page fault. It has been experimentally measured that the average time taken for a memory access in the process is $X$ units.

Which one of the following is the correct expression for the page fault rate experienced by the process?

  1. $(D-M)/(X-M)$
  2. $(X-M)/(D-M)$
  3. $(D-X)/(D-M)$
  4. $(X-M)/(D-X)$

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (B) $(X-M)/(D-M)$

Explanation

Let $p$ be the probability that an access causes a page fault. An access takes $M$ units with probability $1-p$ and $D$ units with probability $p$.

The measured mean is therefore $X=(1-p)M+pD$. Subtract $M$ and collect terms to obtain $X-M=p(D-M)$.

Thus the page-fault rate is
$$p=\frac{X-M}{D-M},$$
option **B**. Here $D$ is the stated total time for a faulting access.

More Memory Management and Virtual Memory questions

All Memory Management and Virtual Memory questions →