[Linux-cachefs] fscache basic question

David Howells dhowells at redhat.com
Wed Aug 31 10:44:58 UTC 2005


Vaclav Hanzl <hanzl at noel.feld.cvut.cz> wrote:

> > how cachefs could be useful for the type of netfs' that use page 
> > cache but not local disk caches.
> 
> It cannot. Thought in theory one could very well setup cachefs on a
> RAM-based block device, this might make sense only in very special
> circumstances when, given a particular file-access pattern, the
> cachefs caching strategy happens to be better than the usual
> page-cache used for files. (Maybe that due to some kernel
> optimizations this 'competition' even does not happen?)

CacheFS is a local disk cache. You could use it in conjunction with another
local disk cache if you wished, though I'd advise against it.

> > a) if the page in the cachefs is still valid (up-to-date), would it 
> > still be in the page-cache? If so, reading from cachefs would not be 
> > efficient then.
> 
> Maybe it is in the page-cache, maybe not. If yes, it is used (I hope).

If the page is already in the page cache, the VM uses it without consulting
the netfs. If it isn't, the netfs gets called to read the page and it would
first consult FS-Cache and only then go to the network if that failed.

David




More information about the Linux-cachefs mailing list