This patch series implements the memory shrinker for NFSv4 clients to react to system low memory condition. The first patch adds a counter to keep track of the number of courtesy clients in the system. The second patch implememts the courtesy client shrinker by creating a new trigger, in addition to the max client limit, for the laundromat to reap courtesy clients. By destroying the courtesy clients, all states associated with these clients are also released. v2: . fix kernel test robot errors in nfsd.h when CONFIG_NFSD_V4 not defined. v3: . add mod_delayed_work in nfsd_courtesy_client_scan to kick start the laundromat. v4: . replace the use of xchg() with vanilla '=' in patch 1. v5: . rename nfsd_courtesy_client_count to nfsd_courtesy_clients . add helper nfsd4_update_courtesy_client_count . move nfsd_register_client_shrinker into nfsd4_init_leases_net . move nfsd4_leases_net_shutdown from nfsd.h to nfs4state.c . do away with shrinker 'scan' callback, just return SHRINK_STOP . remove unused nfsd_client_shrinker_reapcount --- Dai Ngo (2): NFSD: keep track of the number of courtesy clients in the system NFSD: add shrinker to reap courtesy clients on low memory condition fs/nfsd/netns.h | 4 ++++ fs/nfsd/nfs4state.c | 60 ++++++++++++++++++++++++++++++++++++++++++++---- fs/nfsd/nfsctl.c | 6 +++-- fs/nfsd/nfsd.h | 6 +++-- 4 files changed, 67 insertions(+), 9 deletions(-)