Negative dentries, 20 years later
Negative dentries, 20 years later
Posted Apr 11, 2022 18:19 UTC (Mon) by dskoll (subscriber, #1630)Parent article: Negative dentries, 20 years later
It seems to me that a negative dentry is useful only to the extent that it's hit. So what if the total number of negative dentries was limited to some small number and if that number is exceeded, then either (1) we evict an entry that has never been hit yet (or hit fewer than N times), or (2) we increase the negative dentry cache size by some amount if all negative dentries have been hit at least once (or at least N times).
This means keeping track of how many times a negative dentry is hit.
Caveat: I'm not a kernel programmer and have no idea how this would work in practice with the existing data structures.
Posted Apr 11, 2022 18:56 UTC (Mon)
by willy (subscriber, #9762)
[Link] (3 responses)
Posted Apr 11, 2022 19:03 UTC (Mon)
by dskoll (subscriber, #1630)
[Link] (2 responses)
Right. I guess limiting the size of the dentry cache so we start evicting before we have general memory pressure is the main idea, but allowing it to expand if by some miracle all entries have been hit so that it scales up if memory is available.
Posted Apr 11, 2022 19:31 UTC (Mon)
by willy (subscriber, #9762)
[Link] (1 responses)
Obviously those numbers are a bit magic. Why not 150? Or 200? Needs some experimentation.
Posted Apr 12, 2022 7:44 UTC (Tue)
by geert (subscriber, #98403)
[Link]
Negative dentries, 20 years later
Negative dentries, 20 years later
Negative dentries, 20 years later
Negative dentries, 20 years later
