How to change relatime access time update interval from 24 hours

filesystems

According to the RHEL 6 documentation about the Relatime Drive Access Optimization:

The kernel used in Red Hat Enterprise Linux 6 supports another alternative — relatime. Relatime maintains atime data, but not for each time that a file is accessed. With this option enabled, atime data is written to the disk only if the file has been modified since the atime data was last updated (mtime), or if the file was last accessed more than a certain length of time ago (by default, one day).

Emphasis mine — this documentation suggests that the access time updating algorithm can be changed to use a different interval than 24 hours, but I have no idea how to actually accomplish this.

There apparently used to be a sysctl option named fs.relatime_interval as mentioned here, but I cannot find it in my Centos 6.5 kernel (2.6.32-431.)

Is it possible to make this value something arbitrary like 12 hours, 6 hours, etc?

Best Answer

It's immutable in the mainline kernel function relatime_need_update() which checks against the hardcoded value of 24*60*60 (1 day), see the source at e.g.:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/fs/inode.c#n1590

Related Question