首页 > 其他 > 详细

Operating System: Three Easy Pieces --- Page Replacement (Note)

时间:2015-10-08 07:58:59      阅读:294      评论:0      收藏:0      [点我收藏+]

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!