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

Jeremy Jackson (jerj@coplanar.net)
Thu, 19 Apr 2001 12:15:10 -0400


Helge Hafting wrote:

> 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.

They why would you tell tar not to use cache? If you know what's happening
next you need to tell the system (feed-forward), not have it try to read your
mind. I'm assuming your modified tar would have an option switch
to cause this behaviour, not be hard coded...

>
>
> 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

Yes, so a script that does the above wouldn't enable no cache mode
for written files. The program doesn't know, but the encompasing
script (or person at console) does.

>
> from a something like this, you probably won't need the backup again
> soon. But this is hard to know in many other cases.

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