PPT Slide
Clock Page Replacement Algorithms
- Clock algorithm with ref/dirty bits (aka Second Chance).
- Test the page frame pointed to by the clock hand
- If ref == 0 && dirty == 0, select this page for replacement;
- If ref == 1, set ref = 0 and continue moving clock hand;
- If ref == 0 && dirty == 1, start writing the page to disk and set the dirty bit == 0 and continue moving clock hand
- If page frame fails test (it finds a 0,0 page frame), replace this page.
- If it passes the test,
- Modify the page frame information according to rules above.
- Move the clock hand to the next page frame.
- Go back to the test step above.
- Idea is to replace the “cheapest, oldest” page frame.