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

Discussion

The reference bit in a page table entry is used mainly by

  • A.replacement algorithms that approximate LRU
  • B.the file system to locate a page on disk
  • C.the scheduler to decide process priority
  • D.the compiler to optimise code

Answer: A

Correct answer: replacement algorithms that approximate LRU

The reference bit is set by hardware whenever a page is read or written, and cleared by the operating system. It is used by replacement algorithms that approximate LRU. The need arises because true LRU is too expensive. Maintaining an exact ordering of pages by last use requires a timestamp or a stack updated on every memory reference, which no practical hardware provides. The reference bit is set for free as a side effect of the access, and one bit is enough to distinguish pages used since the last sweep from pages not used at all. The second-chance or clock algorithm uses it directly: a page at the head of the queue with its bit set is spared and the bit cleared, so only a page unused since the last sweep is evicted. The additional-reference-bits refinement keeps a byte per page, shifting the reference bit in at intervals, which gives a coarse history rather than a single bit and approximates LRU more closely at modest cost.

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

Post your comment

Please log in or register to post a comment.