vfs_cache_pressure

file: /proc/sys/vm/vfs_cache_pressure
variable: vm.vfs_cache_pressure
Official reference

This percentage value controls the tendency of the kernel to reclaim the memory which is used for caching of directory and inode objects.

At the default value of vfs_cache_pressure=vfs_cache_pressure_denom the kernel will attempt to reclaim dentries and inodes at a “fair” rate with respect to pagecache and swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer to retain dentry and inode caches. When vfs_cache_pressure=0, the kernel will never reclaim dentries and inodes due to memory pressure and this can easily lead to out-of-memory conditions. Increasing vfs_cache_pressure beyond vfs_cache_pressure_denom causes the kernel to prefer to reclaim dentries and inodes.

Increasing vfs_cache_pressure significantly beyond vfs_cache_pressure_denom may have negative performance impact. Reclaim code needs to take various locks to find freeable directory and inode objects. When vfs_cache_pressure equals (10 * vfs_cache_pressure_denom), it will look for ten times more freeable objects than there are.

Note: This setting should always be used together with vfs_cache_pressure_denom.