谁熟悉LRU的改进算法2Q算法?

braveman82 2005-01-29 11:01:28
A solution to the tuning problem is to store point-
ers to the page8 in Al instead of the page8 themselves.
This solution lets Al remember enough past references
to be responsive to moderately hot pages, yet preserve
ail page slot8 for the Am queue. We found that this so-
lution works well for traces generated from stationary
distributions, but performs poorly for actual traces.
In real access patterns, the locality of reference can
change very quickly. A common occurrence is for a
page to receive many references for a short period of
time (i.e., correlated references), then no references for
a long time. When a new page is accessed, it should be
retained for a period of time to satisfy the correlated
references, then ejected from the buffer if it does not
receive any further references
2Q, Full Version
To resolve the above problems we partition Al into
Alin and Alout. The most recent first. accesses will
be in the memory (up to a certain threshold), but then
older first accesses will be thrown out of memory but
remembered in Alout. (Remembering a page address
requires only a few bytes (fewer than lo).) Given a
buffer size B, one divides it into Am, Alin (of max-
imum size Kin and minimum size l), and Alout (of
maximum size Kout). Fixing these parameter8 is per
tentially a tuning question though the following val-
ues work well: Kin should be 25% of the page slot8
and Kout should hold identifier8 for as many pages as
would fit on 50% of the buffer.
This algorithm solves the correlated reference prob-
lem by retaining newly referenced pages in Alin to sat-
isfy repeated requests. If a page in Alin is accessed, it
isn’t promoted to Am, because the second access may
simply be a correlated reference. The Alout buffer,
by contrast, is used to detect page8 that have high
long-term access rates.

不知道Aout对列中存放的页的指针数(也就是上面提到的50%)
是指内存中所有页的50%,还只是高速缓存中的所能存放的页数的50%
其他的我既本上都明白了,
也就是对下面这句话如何理解
Kout should hold identifier8 for as many pages as
would fit on 50% of the buffer.



还有,如何模拟访问页的顺序?
不能用随机数生成把?



注:由于是pdf格式转化成txt格式的。可能有些地方的字有些不对
...全文
246 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
jixingzhong 2005-08-02
  • 打赏
  • 举报
回复
如何写页面置换算法的驱动程序




这个可以参考 操作系统 的内存管理
braveman82 2005-01-30
  • 打赏
  • 举报
回复
我自己顶。
我现在就想知道
如何模拟cpu访问内存中的页面的顺序?也就是页号的顺序

换句话说,如何写页面置换算法的驱动程序
braveman82 2005-01-30
  • 打赏
  • 举报
回复
接着顶

3,881

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 其它技术问题
社区管理员
  • 其它技术问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧