Re: [Linux-cachefs] fscache basic question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, David and Vaclav,

Many Thanks to both of you for clearing my earlier doubts and the nice explanation of cache hierarchy in particular.

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.

So suppose a page is cache by one client of a cluster file system (say GFS/Lustre), this means if the client VM caches a page in its page cache, it must hold the correct locks for that page then. Otherwise, it would be a race condition if another client modifies this page, right?

It occurs to me the key is the explanation of page cache being read-through rather than be looked aside. I was thinking more from file read/write path, and got lost when I thought a client must confirm with servers about the state of a file, before reading from the page cache. I guess the locking of cluster file systems would play a role here to guarantee the consistency of cached pages then.

Thanks again,
Weikuan

On Aug 31, 2005, at 6:44 AM, David Howells wrote:

Vaclav Hanzl <hanzl@xxxxxxxxxxxxxxxxx> 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



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]
  Powered by Linux