CS FundamentalsVery hardGATE CS (PYQ pattern)

The enhanced clock algorithm uses (R, M) bits with 3 frames (initially empty, newly loaded pages get R = 1 and M = 1 if loaded by a write). On a fault the hand scans once from its position for a frame with (0,0); if none, it scans once for (0,1), clearing R on every frame it passes with R = 1; this pair of scans repeats until a victim is found; the hand then moves one past the victim. References (R = read, W = write): 1W, 2R, 3W, 4R, 1R, 5W, 2W, 3R, 6R, 1W, 4R, 5R. How many page faults and how many dirty write-backs occur?

  1. A. 11 faults, 4 write-backs
  2. B. 12 faults, 4 write-backs
  3. C. 11 faults, 5 write-backs
  4. D. 10 faults, 3 write-backs

Correct answer: A. 11 faults, 4 write-backs

Simulating the two-scan victim search with the hand moving past each victim gives 11 faults; of the evicted pages 4 were dirty.

More Operating Systems questions

Exams that ask this topic