Machine-translated by Google. Questions are authored in English.
Top

Discussion

When a page must be replaced and the victim page is clean, the operating system can

  • A.discard it without writing it to disk
  • B.write it to disk twice for safety
  • C.convert it into a dirty page
  • D.refuse the replacement

Answer: A

Correct answer: discard it without writing it to disk

A clean page is one that has not been modified since it was loaded, so an identical copy already exists on the backing store. It can simply be discarded, and the frame reused at once. A dirty page must first be written out, which costs a disk write of several milliseconds - and that write sits in the critical path of the page fault, delaying the process that is waiting. The distinction is recorded by the dirty bit, set by hardware on any write to the page. Because the difference in cost is so large, some replacement algorithms weigh the dirty bit alongside recency, preferring a clean victim where the choice is close. The enhanced second-chance algorithm does exactly this, ranking pages by the pair of reference and dirty bits. Code pages are typically read-only and therefore always clean, which makes them cheap to evict - one reason a program under memory pressure loses its instructions before its data. Some systems also write dirty pages out in the background to keep clean pages available.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.