13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Page-replacement policies 1137.11 WSCLOCKThe WSCLOCK method was recently proposed as a hybrid between NUR and WorkingSet. As with NUR, it searches for pages to discard, starting with the page where the previoussearch left off. These searches are conducted in the page-frame table, not in anyparticular process page table. When a page fault occurs in any process, a scan startsthrough the table. Pages with true Used field are passed over, but the field is reset tofalse. In addition, the kernel stores the virtual time of the owning process in a‘‘Referenced-time’’ field in that table. Referenced time is an estimate of the last time thepage was used.If the scan encounters a page with a false Used field, the page might still be in theworking set of its owner. The current virtual time of its owner is compared with thereferenced time. If the difference is less than w , the scan continues. Otherwise, the pagehas left the working set and may be swapped out.<strong>An</strong> entire scan through all page frames may fail to find a replaceable page. Thissituation signals overcommitment of main store, a problem that can be relieved by reducingthe multiprogramming level.7.12 Missing Used fieldThe DEC VAX lacks a Used field. This flaw has led to a clever software simulation ofthat field. The storage manager resets the Present field to false in the page table wheneverit wants to reset the non-existent Used field. A mirror table indicates to the storagemanager that the page is still present. If the program accesses a page with false Presentfield, the hardware causes a page fault. However, the storage manager is not fooled andjust sets Present back to true. At the same time, the storage manager has learned that thepage has been accessed, so it records that fact in its mirror table, which does have a Usedfield.This technique is fairly expensive because the trap takes some time to service(about 250 microseconds), so it must be used carefully. The Present field must be reset tofalse only occasionally, or the cost of handling phantom page faults will be unreasonable.7.13 Classification of replacement methodsNow that we have looked at a few page-replacement methods, we should step back andexamine the larger issues.

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

Saved successfully!

Ooh no, something went wrong!