码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-10-08 08:00:14      阅读:137      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!