免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 572 | 回复: 0
打印 上一主题 下一主题

Workaround for [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-10-22 15:41 |只看该作者 |倒序浏览
    刚go through了一下2.6.23的change log. 发现一个叫 "Lumpy" reclaim 的新feature. 可以缓解上一篇文章里所说的memory fragment的现象. 它并不是在分配机制上下手(以前看到一个patch是给分配的页归为Kernel, UserSpace, Reserve三类去管理), 而是在page reclaim的算法上做了个变动,  改动在try_to_free_pages里, 将原先只scan LRU链上指定数量的inactive页来回收, 改为:
1) 查找LRU每个指定scan的页, 如果能回收, 放入队列
2) 将该页开始的物理连续页都遍历(遍历数量是由caller指定), 如果在LRU上并能回收, 就将其放入回收队列里.
但是最后这些放入回收队列的页是否能被回收, 还需要过很复杂的流程:shrink_page_list().
不知效果如何, 有时间那板子来试试. 估计分配大块连续页的时候会很慢.
付上对这个patch的描述:
Lumpy Reclaim (V3)
When we are out of memory of a suitable size we enter reclaim.
The current reclaim algorithm targets pages in LRU order, which
is great for fairness but highly unsuitable if you desire pages at
higher orders.  To get pages of higher order we must shoot down a
very high proportion of memory; >95% in a lot of cases.
This patch set adds a lumpy reclaim algorithm to the allocator.
It targets groups of pages at the specified order anchored at the
end of the active and inactive lists.  This encourages groups of
pages at the requested orders to move from active to inactive,
and active to free lists.  This behaviour is only triggered out of
direct reclaim when higher order pages have been requested.
This patch set is particularly effective when utilised with
an anti-fragmentation scheme which groups pages of similar
reclaimability together.
This patch set (against 2.6.19-rc5-mm2) is based on Peter Zijlstra's
lumpy reclaim V2 patch which forms the foundation.  It comprises
the following patches:
lumpy-reclaim-v2 -- Peter Zijlstra's lumpy reclaim prototype,
lumpy-cleanup-a-missplaced-comment-and-simplify-some-code --
  cleanups to move a comment back to where it came from, to make
  the area edge selection more comprehensible and also cleans up
  the switch coding style to match the concensus in mm/*.c,
lumpy-ensure-we-respect-zone-boundaries -- bug fix to ensure we do
  not attempt to take pages from adjacent zones, and
lumpy-take-the-other-active-inactive-pages-in-the-area -- patch to
  increase aggression over the targetted order.
Testing of this patch set under high fragmentation high allocation
load conditions shows significantly improved high order reclaim
rates than a standard kernel.  The stack here it is now within 5%
of the best case linear-reclaim figures.
It would be interesting to see if this setup is also successful in
reducing order-2 allocation failures that you have been seeing with
jumbo frames.
Please consider for -mm.
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/14459/showart_405270.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP