标签:
Thus far, the way we have described how replacements occur assumes that the OS waits until
memory is entirely full, and only then replaces or evicts a page to make room for some other pages.
As you can imagine, this is a little bit unrealistic, and there are many reasons for the OS to keep a
small portion of memory free more proactively. To keep a small amount of memory free, most OSs
thus have some kind of high watermark (HW) and low watermark (LW) to help decide when to start
evicting pages from memory. How this works is as follows: When the OS notices that there are fewer
than LW pages available, a background thread that is responsible for freeing memory runs. The thread
evicts pages until there are HW pages available. The background thread, sometimes called the Swap
daemon or page daemon, then goes to sleep, happy that it has freed some memory for running
processes and the OS to use. By performing a number of replacements at once, new performance
optimizations become possible. For example, many systems will cluster or group a number of pages
and write them out at once to the swap partition, thus increasing the efficiency of the disk; as we will
see later when we discuss disks in more detail, such clustering reduces seek and rotational overhead
of a disk and thus increases performance noticeably.
Operating System: Three Easy Pieces --- Page Replacement (Note)
标签:
原文地址:http://www.cnblogs.com/miaoyong/p/4859982.html