[LTP] [PATCH] fanotify10: Calling drop_cache twice to ensure the inode is evicted
Amir Goldstein
amir73il@gmail.com
Wed Sep 4 10:57:58 CEST 2024
On Tue, Sep 3, 2024 at 4:08 PM Petr Vorel <pvorel@suse.cz> wrote:
>
> Hi all,
>
> > In this test case, some scenarios are designed to verify whether the
> > FANOTIFY_EVICTABLE flag takes effect: by verifying that information cannot
> > be obtained from the corresponding inode after drop_cache, as this flag
> > does not ping the inode.
>
> > However, drop_cache is only performed once here, which may result in the
> > inode not being released in NUMA scenarios. Suppose the inode is located
> > on NUMA0 and the dentry is located on NUMA1; the first drop_cache can only
> > ensure that the inode is added to the LRU list, but does not guarantee that
> > evict() can been called because dispose_list does not yet include this
> > inode when traversing NUMA0, which causes the testcase execution fail.
>
> I wonder if there can be some detection that inode is evicted.
> Or, can it happen that even 2x drop is not enough?
>
> > For the single-file scenario in this testcase, executing drop_cache twice
> > is necessary to ensure the inode is evicted, thus allowing the testcase to
> > pass.
>
> Acked-by: Petr Vorel <pvorel@suse.cz>
>
> @Amir, Jan, could you please have a look?
>
Same solution was already applied to fanotify23
8ccf5b45c fanotify23: Make evictable marks tests more reliable
So ACK.
BTW, fanotify23 also restricts itself to ext2 for more deterministic
inode eviction behavior, so this could be considered for fanotify10 as well.
For example, AFAIK, xfs has its own internal eviction logic, which can keep
inodes in cache for one more shrinker cycle.
Thanks,
Amir.
More information about the ltp
mailing list