Consider a process executing on an operating system that uses demand paging.…
2018
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?
- A.
\((D – M) / (X – M)\) - B.
\((X – M) / (D – M)\) - C.
\((D – X) / (D – M)\) - D.
\((X – M) / (D – X)\)
Attempted by 132 students.
Show answer & explanation
Correct answer: B
Derivation:
Let p be the page fault rate (probability that an access causes a page fault).
Average access time equals the weighted average of the two cases:
X = (1 − p) · M + p · D
Rearrange: X = M + p · (D − M)
Solve for p:
X − M = p · (D − M)
p = (X − M) / (D − M)
Final expression for the page fault rate:
(X − M) / (D − M)
Notes: This requires D ≠ M. Also check that the computed value lies between 0 and 1 to be a valid probability; if not, review the measured values.
A video solution is available for this question — log in and enroll to watch it.