> On Jul 14, 2022, at 12:17 PM, Dai Ngo <dai.ngo@xxxxxxxxxx> wrote: > > This patch series enforces a limit on the number of v4 clients allowed > in the system. With Courteous server support there are potentially a > lots courtesy clients exist in the system that use up memory resource > preventing them to be used by other components in the system. Also > without a limit on the number of clients, the number of clients can > grow to a very large number even for system with small memory configuration > eventually render the system into an unusable state. > > v2: > . move all defines to nfsd.h > . replace unsigned int nfs4_max_client to int > . kick start laundromat in alloc_client when max client reached. > . restyle compute of maxreap in nfs4_get_client_reaplist to oneline. > . redo enforce of maxreap in nfs4_get_client_reaplist for readability > . use bit-wise interger to compute usable memory in nfsd_init_net. > . replace NFS4_MAX_CLIENTS_PER_4GB to NFS4_CLIENTS_PER_GB. > . use all memory, including high mem, to compute max client. Hello Dai, I applied these two to NFSD's for-next branch for early adopters and other testing and review. > --- > > Dai Ngo (2): > NFSD: keep track of the number of v4 clients in the system > NFSD: limit the number of v4 clients to 1024 per 1GB of system memory > > fs/nfsd/netns.h | 3 +++ > fs/nfsd/nfs4state.c | 28 ++++++++++++++++++++-------- > fs/nfsd/nfsctl.c | 8 ++++++++ > fs/nfsd/nfsd.h | 2 ++ > 4 files changed, 33 insertions(+), 8 deletions(-) > -- > Dai Ngo > -- Chuck Lever