On 2/5/25 10:04 PM, NeilBrown wrote: > On Thu, 06 Feb 2025, Dave Chinner wrote: >> >> However, *every single shrinker implementation in the kernel* uses >> this algorithm whether they use list-lru or not. > > Yes, but we aren't doing shrinking here. We are doing ageing. The NFSD filecache uses this mechanism for both aging and shrinking. What might be appropriate is to provide a list_lru API for aging. That would have the benefit of using an existing common mechanism but make it more appropriate for NFSD's usage scenario. > We want > a firm upper limit to how long things remain cached after the last use. Do we need a firm limit? The age limit is not about correctness, is it? What we don't want is a remote file access via NFSv3 to keep a file open indefinitely. The current 2 second value is not a deep requirement, it's merely a value that seems to work well. That aspect is a little different than inode/dentry caching, where it can be valuable (and at least, won't be harmful) to leave the item in the cache. -- Chuck Lever