Using the Reference Bit
Various LRU approximations use the PTE reference bit.
- keep a counter for each page
- at regular intervals, do:
- for every page:
- if ref bit = 0, increment its counter
- if ref bit = 1, zero its counter
- zero the reference bit
- the counter will thus contain the number of intervals since the last reference to the page.
- the page with the largest counter will be least recently used one.
If we don’t have a reference bit, we can simulate it using the VALID bit and taking a few extra faults.
- therefore want impact when there is plenty of memory to be low.