nodiratime
nodiratime
Posted Aug 9, 2007 16:12 UTC (Thu) by elanthis (guest, #6227)Parent article: Once upon atime
Everyone knows about noatime, but it seems almost nobody uses nodiratime.
The thread this discussion was in notes that the kernel devs like Linus explicitly not only noatime, but also nodiratime. I ASSume that noatime only affects files and that directories need nodiratime.
Posted Aug 9, 2007 16:17 UTC (Thu)
by corbet (editor, #1)
[Link] (4 responses)
Posted Aug 9, 2007 20:17 UTC (Thu)
by tarvin (guest, #4412)
[Link] (3 responses)
Are you sure about noatime implying nodiratime? mount(8) states: while mount(2) puts it this way: I wonder how to interpret mount(2)'s (all types of) files for noatime: Is a directory considered a file in this context?
Posted Aug 9, 2007 20:39 UTC (Thu)
by corbet (editor, #1)
[Link] (2 responses)
So if NOATIME is set, the NODIRATIME flag is never even checked.
Posted Aug 10, 2007 6:41 UTC (Fri)
by tarvin (guest, #4412)
[Link] (1 responses)
- But your definite statement is comforting, thanks. I'll keep using just "noatime".
Posted Aug 10, 2007 14:26 UTC (Fri)
by jzbiciak (guest, #5246)
[Link]
noatime implies nodiratime - it's a superset. You can use nodiratime by itself to turn off the updates on directories only. As you note, it does not seem to be widely used.
nodiratime
Does noatime imply nodiratime?
noatime
Do not update inode access times on this file system[...]
nodiratime
Do not update directory inode access times on this filesystem.
MS_NOATIME
Do not update access times for (all types of) files on this file system.
MS_NODIRATIME
Do not update access times for directories on this file system.
Yep, I'm sure. When in doubt, use the source. From touch_atime() in fs/inode.c:
Does noatime imply nodiratime?
void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
{
/* ... */
if (inode->i_flags & S_NOATIME)
return;
if (IS_NOATIME(inode))
return;
if ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode))
return;
OK. I've been using noatime systematically for years. And then I read about a prominent kernel developer like Molnar using both noatime and nodiratime, making me worried: Have I been missing out on I/O-performance for years?Does noatime imply nodiratime?
Actually, Andrew Morton actually corrected Ingo on this point:
Does noatime imply nodiratime?
From: Andrew Morton
To: Ingo Molnar
Subject: Re: [PATCH 00/23] per device dirty throttling -v8
Date: Sun, 5 Aug 2007 00:29:34 -0700
On Sun, 5 Aug 2007 09:21:41 +0200 Ingo Molnar [email blocked] wrote:
> even on a noatime,nodiratime filesystem
noatime is a superset of nodiratime, btw.
I trust Andrew on this point. :-)