Positive to negative ratio
Positive to negative ratio
Posted Jul 7, 2026 17:15 UTC (Tue) by farnz (subscriber, #17727)In reply to: Positive to negative ratio by kleptog
Parent article: Limiting negative dentries
The same applies to positive dentries, too - while they don't have the cache size explosion potential of negative dentries (being bounded by the number of entries in the directory), it seems wasteful to keep a positive dentry for omp.h that's never referenced again, when you could use the cache space for a negative dentry for limits.h that's being referenced every 90 seconds.
It does feel like the necessary change is to have a size limit on the dentry cache (so that it can't be multiple gigabytes in size), and to have a cache replacement policy that accounts for many dentries never being reused - a split LRU (like the active/inactive lists for page cache), or a LFUDA type policy.
