Derek Siu <golf1123@xxxxxxxxx> wrote: > After I called fscache_read_or_alloc_pages(), can I assume that the > pages will not be swapped out of the page cache? No. I have no control over the netfs's page cache. The way NFS and AFS do it is to set a bit in their page structs[*] when they've been bound to theoretical cache blocks. Then when releasepage() and invalidatepage() are called, this bit is noted, and the page is unbound from the cache (if it's not busy in the case of releasepage() without __GFP_WAIT set). [*] AFS uses PG_private; for NFS it's a little more complicated, but it uses a bit in page->private and PG_private is set to indicate page->private needs to be taken account of. Both NFS and AFS use PG_fs_misc to indicate a page that's being written to the cache. It is set when a write to the cache is initiated, and it is cleared by the completion of the write operation. invalidatepage() and releasepage() with __GFP_WAIT will wait for PG_fs_misc to be cleared before returning. David