diff options
author | Dai Ngo <dai.ngo@oracle.com> | 2022-07-15 16:54:53 -0700 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2022-07-29 20:16:56 -0400 |
commit | 4271c2c0887562318a0afef97d32d8a71cbe0743 (patch) | |
tree | 6e09d77bfaa2cfe8c2da92ce7722ce02f5ddb711 /fs/nfsd/netns.h | |
parent | 0926c39515aa065a296e97dfc8790026f1e53f86 (diff) | |
download | lwn-4271c2c0887562318a0afef97d32d8a71cbe0743.tar.gz lwn-4271c2c0887562318a0afef97d32d8a71cbe0743.zip |
NFSD: limit the number of v4 clients to 1024 per 1GB of system memory
Currently there is no limit on how many v4 clients are supported
by the system. This can be a problem in systems with small memory
configuration to function properly when a very large number of
clients exist that creates memory shortage conditions.
This patch enforces a limit of 1024 NFSv4 clients, including courtesy
clients, per 1GB of system memory. When the number of the clients
reaches the limit, requests that create new clients are returned
with NFS4ERR_DELAY and the laundromat is kicked start to trim old
clients. Due to the overhead of the upcall to remove the client
record, the maximun number of clients the laundromat removes on
each run is limited to 128. This is done to ensure the laundromat
can still process the other tasks in a timely manner.
Since there is now a limit of the number of clients, the 24-hr
idle time limit of courtesy client is no longer needed and was
removed.
Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/netns.h')
-rw-r--r-- | fs/nfsd/netns.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h index ce864f001a3e..ffe17743cc74 100644 --- a/fs/nfsd/netns.h +++ b/fs/nfsd/netns.h @@ -191,6 +191,7 @@ struct nfsd_net { siphash_key_t siphash_key; atomic_t nfs4_client_count; + int nfs4_max_clients; }; /* Simple check to find out if a given net was properly initialized */ |