[8/8] NFS: Limit the size of the access cache by default
diff mbox series

Message ID 20200210191345.557460-9-trond.myklebust@hammerspace.com
State New
Headers show
Series
  • Reduce the refcount pressure of NFS on struct cred
Related show

Commit Message

Trond Myklebust Feb. 10, 2020, 7:13 p.m. UTC
Currently, we have no real limit on the access cache size (we set it
to ULONG_MAX). That can lead to credentials getting pinned for a
very long time on lots of files if you have a system with a lot of
memory.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 fs/nfs/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 09bcbdc67135..133bf23430e8 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -2307,7 +2307,7 @@  static DEFINE_SPINLOCK(nfs_access_lru_lock);
 static LIST_HEAD(nfs_access_lru_list);
 static atomic_long_t nfs_access_nr_entries;
 
-static unsigned long nfs_access_max_cachesize = ULONG_MAX;
+static unsigned long nfs_access_max_cachesize = 4*1024*1024;
 module_param(nfs_access_max_cachesize, ulong, 0644);
 MODULE_PARM_DESC(nfs_access_max_cachesize, "NFS access maximum total cache length");