Re: Is there a way to turn file caching off ?

Helge Hafting (helgehaf@idb.hist.no)
Thu, 19 Apr 2001 10:21:14 +0200


Jeremy Jackson wrote:

> currently all the kernel's heuristics are feed-back control loops.
> what you are asking for is a feed-forward system: a way for the application
> to tell kernel "I'm only reading this once, so after I'm done, throw it out
> straight away"
> and "I'm only writing this data, so after I'm done, start writing it out and
> then forget it"
>
This is hard to get right. Sure - your unpack/copy program read once
and
writes once. But the stuff might be used shortly thereafter by
another process. For example: I unpack a kernel tarball. tar
knows it writes only once and might not need more than 5M to do
this as efficient as possible with my disks. A lot of other cache
could be saved, fewer things swapped out.
But then I compile it. Todays system ensures that lots of the source
is in memory already. Limiting the caching to what tar needed
however will force the source to be read from disk once during
the compile - not what I want at all.

A program may know its own access pattern, but it don't usually know
future access patterns. Well, backing up the entire fs could benefit
from a something like this, you probably won't need the backup again
soon. But this is hard to know in many other cases.

Helge Hafting
-
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/