Hi,
As I'am looking more into the cachefs code, I am quite a bit confused
about how cachefs could be useful for the type of netfs' that use page
cache but not local disk caches. Suppose in the read case, the part I
do not catch is as follows. When a page is first read from server and
marked up-to-date, it is then stored in the cachefs. By the time it is
to be read again, we want to read it from cachefs assuming local disk
access is faster than going for remote server.
My questions here are as follows:
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.
b) Is it possible that the page is already evicted from pagecache, but
it is still in the cachefs? In that case, the page can then be read
back from cachefs and stored back into page cache if possible. Also in
this case, when trying to read from pagecache or cachefs, is it
guaranteed that the cached file page is not out-of-date w.r.t the copy
at the server side.
I might have just asked some naive questions. Please bear with me. But
they puzzle me quite a bit. I appreciate anybody who would like to help
clear my doubts here.
Thanks,
Weikuan