• Dai Ngo's avatar
    NFSD: limit the number of v4 clients to 1024 per 1GB of system memory · 4271c2c0
    Dai Ngo authored
    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: default avatarDai Ngo <dai.ngo@oracle.com>
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    4271c2c0
nfsd.h 19.4 KB