CS FundamentalsModerateGATE CS (PYQ pattern)

A 100 MB process is swapped out and later swapped back in on a disk that transfers 50 MB/s with an 8 ms latency per transfer. Swap-out writes only the process's dirty pages (40% of its image; the clean ones are discarded and their swap copies are still valid) in one transfer; swap-in reads the whole image in one transfer. What is the total I/O time?

  1. A. 4.016 s
  2. B. 2.808 s
  3. C. 1.616 s
  4. D. 2.816 s

Correct answer: D. 2.816 s

Swap-out: 40 MB / 50 MB/s + 8 ms = 0.808 s. Swap-in: 100 MB / 50 MB/s + 8 ms = 2.008 s. Total 2.816 s. Writing the full image gives 4.016 s; charging the latency only once gives 2.808 s; reading back only the dirty part gives 1.616 s.

More Operating Systems questions

Exams that ask this topic