You may have noticed that Case 3 presents an interesting situation: apparently these
pages have been modified without being referenced. How is that possible? The key lies
in how the referenced bit is manipulated by the operating system. When the pages are
brought into memory, they are all usually referenced at least once and that means that
all of the pages soon have a referenced bit of 1. Of course the LRU algorithm would
be defeated if every page indicated that it had been referenced. Therefore, to make sure
the referenced bit actually indicates recently referenced, the operating system periodically
resets it to 0. Then, as the pages are referenced during processing, the bit is
changed from 0 to 1 and the LRU policy is able to identify which pages actually are
frequently referenced. As you can imagine, there is one brief instant, just after the bits
are reset, in which all of the pages (even the active pages) have reference bits of 0 and
are vulnerable. But as processing continues, the most-referenced pages soon have their
bits reset to 1, so the risk is minimized.