Re: Suggestion for O_DIRECT and friends

Arjan van de Ven (arjan@stack.nl)
Mon, 21 Dec 1998 09:18:45 +0100 (CET)


On Sun, 20 Dec 1998, Rogier Wolff wrote:
> > O_Serialized
> > Hints the kernel that the file is read in a serial/linear way,
> > and that caching old results isn't usefull but that Read-ahead,
> > Read-behind and Write-clustering are.
> >
> > Possible usage:
> > * tar, gzip and others
>
> So tar sets this flag. On my 384Mb machine, I unpack a new
> linux-kernel when I start to compile it the whole 35Mb of linux-sources
> has to be read back in from disk :-(
>
> It is all about interaction.....

The tar (and gzip?) case is a little more complicated than I suggested:

tar -cvf NEWARCHIVE.tar file1 file2 ...

Here, file1 should be opened "O_ENTIRE" and the NEWARCHIVE.tar can be
opened "O_SERIALIZED". This probably should not mean that no caching takes
place, but if memory is at a premium (ie, there is better use for it), the
already written .tar file can be dropped first.

tar-xvf OLDARCHIVE.tar

Here, an O_SERIALIZED could be used for the .tar file, but you are right,
for the output-files, no options should be given because it is likely you
want to use them again.

For gzip; you know that you throw the input file away when you are done so
caching it is useless anyway.

Greetings,
Arjan van de Ven

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/