lkml.org 
[lkml]   [2004]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] O_NOATIME support
From
On Mon, Jun 14, 2004 at 09:57:11AM -0700, David Lang wrote:
> On Mon, 14 Jun 2004, Cesar Eduardo Barros wrote:
> >On Mon, Jun 14, 2004 at 10:55:29AM +0100, Christoph Hellwig wrote:
> >>On Fri, Jun 11, 2004 at 10:11:29PM -0300, Cesar Eduardo Barros wrote:
> >>>(not subscribed to lkml, please CC: me on replies)
> >>>
> >>>This patch adds support for the O_NOATIME open flag (GNU extension):
> >>>
> >>>int O_NOATIME Macro
> >>> If this bit is set, read will not update the access time of the file.
> >>> See File Times. This is used by programs that do backups, so that
> >>> backing a file up does not count as reading it. Only the owner of the
> >>> file or the superuser may use this bit.
> >>>
> >>>It is useful if you want to do something with the file atime (for
> >>>instance, moving files that have not been accessed in a while to
> >>>somewhere else, or something like Debian's popularity-contest) but you
> >>>also want to read all files periodically (for instance, tripwire or
> >>>debsums).
> >>>
> >
> >Besides, O_NOATIME is most important not for the program that's moving
> >the files elsewhere, but for these checksum-the-world utilities that
> >read every single file they can see, and in the process manage to
> >destroy the usefulness of the atime, or backup programs that also read
> >everything they can touch. Both currently have to use utimes after
> >reading the whole file to restore the atime it had when they began
> >reading, which can take a long time if the file is huge (but note that
> >the mtime doesn't change since they are all reading, not writing).
> >
> >O_NOATIME would also be useful for things like tar --atime-preserve,
> >cpio --reset-access-time, star -atime, pax -t, and others.
>
> This sounds like the same catagory of use that does a single pass through
> the data and is destroying our memory useage. should this flag also imply
> that the data gets thrown away immediatly after being freed by the
> program?
>
> that way you don't have to worry if the software reads the data once or
> ten times, as long as it doesn't go back to it after it has freed it.

No, that would be surprising behaviour. O_NOATIME means the atime
shouldn't be changed -- no more, no less. Nothing prevents me from doing
complex read patterns on the file while using O_NOATIME (for instance,
if I know the internal format of the file, I might use a random access
pattern, read parts of the file more than once, or something like that).

If you want drop-behind, you should be able to say it explicitly (and in
fact most people would probably want it but not O_NOATIME -- for
instance, a media player, after reading the headers, reads the file
mostly in sequence). I believe that would work better as a fcntl (since
you would want to read the headers before setting it to sequential).

--
Cesar Eduardo Barros
cesarb@nitnet.com.br
cesarb@dcc.ufrj.br
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.110 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site