Re: Caching idea

Clayton O'Neill (
Thu, 29 Jun 1995 14:07:34 -0500 (CDT)

On Thu, 29 Jun 1995, Jim Nance wrote:
> This is in response to a message about caching NFS file to disk that was
> posted here a few days ago. Of course I deleted the message and then
> decided to reply to it :-(. The basic idea was to cache NFS files to a local
> disk since NFS is slow. I have also seen a suggestion to do the same for
> CDROMS since they are also slow.
> It occured to me yesterday that a relitivly elegant way to accomplish this
> might be to change the buffer cache so that blocks which hold data from
> slow devices could be made swappable. Since the buffer cache and the swap
> code seem to be fairly integrated at the moment, it does not seem like this
> would be a huge change, and it is certainly prettier than having each slow
> device have it own cache file, and it own cache manager (and its own cache
> manager bugs). Have I overlooked anything important?

Just few things that I can think of, and one is trivial. How would you
specify this? I assume that you'd do it through a mount time option, but
I suppose that it could also be a per block device flag that could be
settable at run-time.

Second, this won't do NFS caching if I under stand how the buffer cache
works. Since there isn't a block device involved it still won't be
cached. I suppose that could be hacked, but I doubt it would be pretty.

Another thing is that it's not dynamically sizable or persistant. Both
of which I see as rather important.

I think overall it's better to implement it as a VFS, that way not only
NFS will benefit, but so will any fs's like userfs, etc. VFS will be more
of a hassle, and not as fast, but we're talking about slow devices

Also, if it is implemented as a VFS I think it's rather important for it
to go through the buffer cache to access the disk cache for obvious reasons.