CS FundamentalsVery hardGATE CS (PYQ pattern)

A system uses LRU with 3 frames (initially empty). A dirty page is written back to disk only when it is evicted; a page is dirty if it was written (W) while resident, and a page loaded by a write is dirty. Pages are not written back when the program ends. References (R = read, W = write): 1R, 2W, 3R, 1W, 4R, 2R, 5W, 1R, 3W, 2R, 4W, 5R. How many disk transfers (page-ins plus write-backs) occur?

  1. A. 15
  2. B. 11
  3. C. 17
  4. D. 13

Correct answer: A. 15

LRU gives 11 page-ins; tracking the dirty bit of each evicted victim gives 4 write-backs; total 15.

More Operating Systems questions

Exams that ask this topic