[$] Dealing with negative dentries

Post Syndicated from original https://lwn.net/Articles/894098/

The problem of negative dentries accumulating in the dentry cache in an
unbounded manner, as we looked at back in
April, came up at the
2022 Linux Storage,
Filesystem, Memory-management and BPF Summit
(LSFMM).
Negative dentries reflect failed file-name lookups, which are then cached,
saving an expensive operation if the file name in question is looked up
again. There is no mechanism to proactively prune back those cache
entries, however, so the cache keeps growing until memory pressure finally
causes the system to forcibly evict some of them, which can make the system
unresponsive for a long time or even cause a soft lockup.