0

我正在研究页面缓存替换策略,我阅读了许多现有算法,其中大多数更喜欢将修改后的页面保留在缓存中。我真的不明白背后的原因。是因为驱逐成本还是修改后的页面有更高的再次使用机会?

4

1 回答 1

0

Out of many different policies LRU(least recently used) policy provides good result with hardware support.
Is it due to eviction cost or modified pages have higher chance of being used again?

Yes
So according to locality of reference the recently modified page has more chances of being referenced again. One more reason of retaining modified page in cache is that every page replacement of modified page (which has higher chances of being referenced again)requires two transfers. Firstly it is written into disk and secondly requested page comes in main memory. This very costly. But in case of non modified page (which has low chances of being referenced) only one transfer takes place i.e. requested page comes in memory.

于 2012-06-27T16:23:55.303 回答