Re: linux-2.4.10-pre5

Kai Henningsen
2001-09-10T08:24:31Z

sim@netnation.com (Simon Kirby) wrote on 09.09.01 in <20010909173947.A20202@netnation.com>:

> What do people actually use atime for, anyway? I've always
> noatime/nodiratime'd most servers I've set up because it saves so much
> disk I/O, and I have yet to see anything really use it. I can see that
> in some cases it would be useful to turn it _on_ (perhaps for debugging /
> removal of unused files, etc.), but it seems silly that the default case
> is a situation which on the surface seems dumb (opening a file for read
> causes a disk write).

I see two possible atime uses:

1. Cleaning up /tmp (mtime is *not* a good indicator that a file is no
longer used)
2. Swapping out files to slower storage

Essentially, both use the "do we still need this thing" aspect.

Of course, for this to be useful, we really need programs to be able to
say "ignore my use of this file". tar --atime-preserve, for example
(which, incidentally, notes a technical problem with doing this). I'd also
add stuff like files or md5sum or similar diagnostic tools to the "might
want to not affect atime" list, and possibly also stuff like inn ("atime
on /var/spool/news is just silly").

HOWEVER, I'd think what would really be nice for this would be an
O_NOATIME flag (which does enforce read-only operation, of course), and
not fixing the atime back afterwards (inherently racy, but even more so by
design of utimes and ctime).

That flag would also be fairly easy to detect with autoconf or similar
functionality.

MfG Kai