免费注册 查看新帖 |

Chinaunix

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

[内存管理] 请问dirtytime_expire_seconds的意义 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2016-03-01 16:31 |只看该作者 |倒序浏览
请大牛解释一下sysctl参数vm.dirtytime_expire_seconds的意义,谢谢!
Document/sysctl/vm.txt的版本好像停留在2.6.29,之后加入的参数都找不到,在网上也没有查到相关资料。

论坛徽章:
9
程序设计版块每日发帖之星
日期:2016-02-11 06:20:00程序设计版块每日发帖之星
日期:2016-02-14 06:20:00程序设计版块每日发帖之星
日期:2016-02-14 06:20:0015-16赛季CBA联赛之吉林
日期:2016-03-23 17:25:0015-16赛季CBA联赛之浙江
日期:2016-04-01 08:25:0615-16赛季CBA联赛之山西
日期:2016-04-01 10:09:1915-16赛季CBA联赛之广夏
日期:2016-06-03 15:58:212016科比退役纪念章
日期:2016-07-28 17:42:5215-16赛季CBA联赛之广东
日期:2017-02-20 23:32:43
2 [报告]
发表于 2016-03-01 16:37 |只看该作者
我在 vm.txt 只有找到 dirty_expire_centisecs,把您找到的 vm.dirtytime_expire_seconds 内容贴出来一下

论坛徽章:
0
3 [报告]
发表于 2016-03-01 17:06 |只看该作者
回复 2# Buddy_Zhang1


    我在整理vm的参数,使用sysctl命令看到的vm.dirtytime_expire_seconds,我只找到了引入这个参数的patch,但是这个patch里也没有对这个参数的工作原理解释太多。

论坛徽章:
20
程序设计版块每日发帖之星
日期:2015-08-17 06:20:00程序设计版块每日发帖之星
日期:2016-07-16 06:20:00程序设计版块每日发帖之星
日期:2016-07-18 06:20:00每日论坛发贴之星
日期:2016-07-18 06:20:00黑曼巴
日期:2016-12-26 16:00:3215-16赛季CBA联赛之江苏
日期:2017-06-26 11:05:5615-16赛季CBA联赛之上海
日期:2017-07-21 18:12:5015-16赛季CBA联赛之青岛
日期:2017-09-04 17:32:0515-16赛季CBA联赛之吉林
日期:2018-03-26 10:02:16程序设计版块每日发帖之星
日期:2016-07-15 06:20:0015-16赛季CBA联赛之江苏
日期:2016-07-07 18:37:512015亚冠之萨济拖拉机
日期:2015-08-17 12:21:08
4 [报告]
发表于 2016-03-02 11:01 |只看该作者
http://lxr.oss.org.cn/source/fs/fs-writeback.c#L87

77 /*
78  * If an inode is constantly having its pages dirtied, but then the
79  * updates stop dirtytime_expire_interval seconds in the past, it's
80  * possible for the worst case time between when an inode has its
81  * timestamps updated and when they finally get written out to be two
82  * dirtytime_expire_intervals.  We set the default to 12 hours (in
83  * seconds), which means most of the time inodes will have their
84  * timestamps written to disk after 12 hours, but in the worst case a
85  * few inodes might not their timestamps updated for 24 hours.
86  */
87 unsigned int dirtytime_expire_interval = 12 * 60 * 60;

1249         {
1250                 .procname       = "dirtytime_expire_seconds",
1251                 .data           = &dirtytime_expire_interval,
1252                 .maxlen         = sizeof(dirty_expire_interval),
1253                 .mode           = 0644,
1254                 .proc_handler   = dirtytime_interval_handler,
1255                 .extra1         = &zero,
1256         },

1900 /*
1901  * Wake up bdi's periodically to make sure dirtytime inodes gets
1902  * written back periodically.  We deliberately do *not* check the
1903  * b_dirtytime list in wb_has_dirty_io(), since this would cause the
1904  * kernel to be constantly waking up once there are any dirtytime
1905  * inodes on the system.  So instead we define a separate delayed work
1906  * function which gets called much more rarely.  (By default, only
1907  * once every 12 hours.)
1908  *
1909  * If there is any other write activity going on in the file system,
1910  * this function won't be necessary.  But if the only thing that has
1911  * happened on the file system is a dirtytime inode caused by an atime
1912  * update, we need this infrastructure below to make sure that inode
1913  * eventually gets pushed out to disk.
1914  */
1915 static void wakeup_dirtytime_writeback(struct work_struct *w);
1916 static DECLARE_DELAYED_WORK(dirtytime_work, wakeup_dirtytime_writeback);

论坛徽章:
0
5 [报告]
发表于 2016-03-02 16:17 |只看该作者
回复 4# nswcfd


    我也找到这段代码了,但是没看太明白,能给解释一下不?

论坛徽章:
20
程序设计版块每日发帖之星
日期:2015-08-17 06:20:00程序设计版块每日发帖之星
日期:2016-07-16 06:20:00程序设计版块每日发帖之星
日期:2016-07-18 06:20:00每日论坛发贴之星
日期:2016-07-18 06:20:00黑曼巴
日期:2016-12-26 16:00:3215-16赛季CBA联赛之江苏
日期:2017-06-26 11:05:5615-16赛季CBA联赛之上海
日期:2017-07-21 18:12:5015-16赛季CBA联赛之青岛
日期:2017-09-04 17:32:0515-16赛季CBA联赛之吉林
日期:2018-03-26 10:02:16程序设计版块每日发帖之星
日期:2016-07-15 06:20:0015-16赛季CBA联赛之江苏
日期:2016-07-07 18:37:512015亚冠之萨济拖拉机
日期:2015-08-17 12:21:08
6 [报告]
发表于 2016-03-03 12:34 |只看该作者
就是一个定时器控制参数,控制什么时候执行wakeup_dirtytime_writeback

论坛徽章:
20
程序设计版块每日发帖之星
日期:2015-08-17 06:20:00程序设计版块每日发帖之星
日期:2016-07-16 06:20:00程序设计版块每日发帖之星
日期:2016-07-18 06:20:00每日论坛发贴之星
日期:2016-07-18 06:20:00黑曼巴
日期:2016-12-26 16:00:3215-16赛季CBA联赛之江苏
日期:2017-06-26 11:05:5615-16赛季CBA联赛之上海
日期:2017-07-21 18:12:5015-16赛季CBA联赛之青岛
日期:2017-09-04 17:32:0515-16赛季CBA联赛之吉林
日期:2018-03-26 10:02:16程序设计版块每日发帖之星
日期:2016-07-15 06:20:0015-16赛季CBA联赛之江苏
日期:2016-07-07 18:37:512015亚冠之萨济拖拉机
日期:2015-08-17 12:21:08
7 [报告]
发表于 2016-03-03 12:35 |只看该作者
控制dirty页面什么时候写回的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP