2

According to one answer relatime interval can be changed by

echo 60 > /proc/sys/fs/relatime_interval

but I do not have such a file? Where did it go?

$ ls /proc/sys/fs
aio-max-nr         file-max          leases-enable  protected_hardlinks
aio-nr             file-nr           mqueue         protected_symlinks
binfmt_misc        inode-nr          nr_open        quota
dentry-state       inode-state       overflowgid    suid_dumpable
dir-notify-enable  inotify           overflowuid    xfs
epoll              lease-break-time  pipe-max-size

Ubuntu 14.04 LTS, kernel 3.16.0-50-generic

0

1 Answer 1

2

IIRC, there once was a RedHat-only patch that made this configurable in RedHat kernels.

Ingo Molnar proposed something similar in 2007, but his patch wasn't merged.

Current kernels use a fixed one-day interval, introduced by commit 11ff6f05f1e836a6a02369a4c4b64757e484adc1 in March 2009.
Excerpt from fs/inode.c:

/*
 * With relative atime, only update atime if the previous atime is
 * earlier than either the ctime or mtime or if at least a day has
 * passed since the last atime update.
 */
static int relatime_need_update(struct vfsmount *mnt, struct inode *inode,
                             struct timespec now)
{

        if (!(mnt->mnt_flags & MNT_RELATIME))
                return 1;
        /*
         * Is mtime younger than atime? If yes, update atime:
         */
        if (timespec_compare(&inode->i_mtime, &inode->i_atime) >= 0)
                return 1;
        /*
         * Is ctime younger than atime? If yes, update atime:
         */
        if (timespec_compare(&inode->i_ctime, &inode->i_atime) >= 0)
                return 1;

        /*
         * Is the previous atime value older than a day? If yes,
         * update atime:
         */
        if ((long)(now.tv_sec - inode->i_atime.tv_sec) >= 24*60*60)
                return 1;
        /*
         * Good, we can skip the atime update:
         */
        return 0;
}

I'm not entirely sure if this also depends on the filesystem used. According to linux-4.2.4/Documentation/filesystems/ocfs2.txt, OCFS2 has atime_quantum...

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .