Re: Checking page_count(page) in invalidate_complete_page

Chuck Lever
2006-09-26T13:12:28Z

Nick Piggin wrote:
> Chuck Lever wrote:
>
>> Nick Piggin wrote:
>>
>>> But they're present on the LRU? That's unusual (I guess NFS doesn't
>>> have a buffer cache for a backing
>>> block device).
>>
>>
>> That is correct -- NFS doesn't use the buffer cache.
>
>
> So that raises another question: how do they get to invalidate_inode_pages2
> if they are not part of the buffer or pagecache?

It does use the page cache to cache data pages for files, directories,
and symlinks. It does not use buffers, however, since incoming file
system data is read from a socket, not from a block device. I believe
the client provides a dummy backing device for the few things in the VFS
that require it.

Invalidate_inode_pages2() is used to remove page cache data that the
client has determined is stale. The client detects that the file has
changed on the server, and it is not responsible for those changes, by
examining the file's attributes and noticing mtime or size changes.
When such a change is detected, all pages cached for a file are
invalidated, and the page cache is gradually repopulated from the server
as applications access parts of the file.

I'd like to understand the difference between invalidate_inode_pages2()
and truncate_inode_pages() in this scenario.