13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

106 Space Management Chapter 33000Random2000Cold faultsbeyond MinFIFO1000LRU00 10 20 30 40 50 60 70 80page frames availableFigure 3.21 Number of page-faults beyond the number for MinOur first realistic attempt to perform better than Random is to discard pages that are notexpected to be needed for a long time. The first-in, first-out method keeps track of theorder in which pages are brought in. When a page frame is needed, this rule is used:FIFOSelect the page frame containing the page that has been inmain store for the longest period of time.This method is usually better than the Random policy because it tends to save recentlyused pages, which have a higher probability of being used again soon because of programlocality. It also follows the Hysteresis Principle, in that it resists swapping pagesout for a long time after they are first brought in. Unfortunately, a frequently used pagestill gets swapped out when it gets to be old enough, even though it may need to beswapped back in immediately.FIFO displays an unexpected behavior: For certain page-reference strings, thefault-rate graph temporarily increases! <strong>An</strong> example of such an anomaly (first discoveredby L. Belady) is the following page-reference string, where the virtual space has 5 pages:012301401234You can check that if physical store has three page frames, there are 9 faults: 3 for thecold start and 6 warm faults. There are 3 accesses without fault. If physical store hasfour page frames, however, there are 10 faults: 4 for the cold start and 6 warm faults.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!