- 论坛徽章:
- 20
|
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); |
|