]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
NFS: return delegations from the end of a LRU when over the watermark
authorChristoph Hellwig <hch@lst.de>
Wed, 7 Jan 2026 07:27:14 +0000 (08:27 +0100)
committerAnna Schumaker <anna.schumaker@oracle.com>
Tue, 20 Jan 2026 19:49:47 +0000 (14:49 -0500)
commit300ca8123c901605eda5eba33c83dc6eb03d0a3c
tree95757cd820a79ba1bc7831d96372101220be0946
parent0ebe655bd033fd84e312980c9eba199604631e7e
NFS: return delegations from the end of a LRU when over the watermark

Directly returning delegations on close when over the watermark is
rather suboptimal as these delegations are much more likely to be reused
than those that have been unused for a long time.  Switch to returning
unused delegations from a new LRU list when we are above the threshold and
there are reclaimable delegations instead.

Pass over referenced delegations during the first pass to give delegations
that aren't in active used by frequently used for stat() or similar another
chance to not be instantly reclaimed.  This scheme works the same as the
referenced flags in the VFS inode and dentry caches.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
fs/nfs/client.c
fs/nfs/delegation.c
include/linux/nfs_fs_sb.h