[Linux-cachefs] Fedora kernel testing

David Howells dhowells at redhat.com
Tue Feb 24 17:49:36 UTC 2009


Daire Byrne <Daire.Byrne at framestore.com> wrote:

> Does it make any sense to have a concept of "lazy" netfs lookups whereby if
> I know that the netfs filesystem won't be changed I can go straight to the
> cache and not have to go to the network at all? Maybe not quite disconnected
> in the sense that perhaps you can relookup the network every 10 mins or so.
> This would be great for high latency networks and small file access.

That would mostly be a case of juggling the NFS access parameters, I would
think, except for one thing: as you mention below, the contents of directories
and the results of lookups are not cached.

> Also would it be possible to cache the contents of dir in a similar 
> fashion? So for example if I mount my home dir over a slow link and have 
> some subdir in my PATHs, applications will only need to go to the network
> the first time to check the existence of a file in a dir (e.g. PATH etc.).
> With something like Lustre perhaps this all becomes far more efficient due 
> to the DLM - you only go to the network when you are notified of a PAGE
> change? Or would you need to keep locks on all cached files for that?

Caching the contents of directories for NFS is something I want to look at.
There are two parts to this: (1) storing a list of dirents that belong to a
directory and (2) storing a list of name to FH mappings (the result of doing
lookups).

With AFS, a directory is read as if it were a file, and then there are rules
for parsing the blob.  This means that lookup is done locally.  This doesn't
always appear to be possible with NFS, though, and depends on whether
READDIRPLUS is available.  This means that scattered data need to be stored in
the cache, but I'm unsure of the best way to do that.

Whatever, it's something that I have on the plan to implement at some point.

> Another application for NFS caching I was thinking about was for storing VM
> images. It is necessary to keep VM images on shared storage for easy 
> migration but you want to minimise the NFS traffic and utilise local storage
> if possible. Would caching the read parts of the image on disk should help? 
> Like before if I know that the VM instance is based on a read-only QCOW2 image
> would it help to force the NFS cache to never revalidate what is on the net
> and go straight to the cache? Obviously writes always have to go to the net.

So, caching of writable files?  That can be made possible for NFS with
relative ease, but you cannot tell whether a write overlapped with another
write on the server from another client, except on NFS4 and then only if the
change attribute is properly implemented on the server.

On the other hand, the pagecache for writable files operates under this same
issue, so it may not be a problem really.

David




More information about the Linux-cachefs mailing list