[Devel] [PATCH rh7] fs/cleancache: fix data invalidation in the cleancache during direct_io

Andrey Ryabinin aryabinin at virtuozzo.com
Wed Apr 12 07:45:43 PDT 2017


On 04/11/2017 08:08 PM, Alexey Kuznetsov wrote:
> Hello!
> 
> Good job!
> 
> Before submitting this to mainstream look
> at truncate_inode_pages.
> 
> It has condition:
> 
> if (mapping->nrpages == 0 && mapping->nrexceptional == 0)
>                 return;
> 
> I have no idea what are those exceptions are, but it definitely
> looks illegal to check only for nrpages in invalidate_inode_pages2_range,
> it clears exceptional entries as well.
> 

AFAIU exceptional entries are either dax entires, they store sector number and
entry size (PMD, PTE,...), or they used by workingset code to store some information
about page eviction. 

Given that, invalidate_inode_pages2_range() supposed to invalidate stale data in page
cache/cleancache (per my understanding at least) I would say that invalidate_inode_pages2_range()
shouldn't remove exceptional entries. But not sure that my understanding is correct,
so I'm going to add ->nrexceptional check in v2, but will ask about this ambiguousity
upstream folks.

> Also I see no point in invalidation of cleancache on entry
> to these routines. It is waste of time, cleancache will be
> repopulated by invalidation (which it stupid, of course).
> It is enough to do this once at exit.
> 

Agreed.


More information about the Devel mailing list