]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nfsd: remove artificial limits on the session-based DRC
authorNeilBrown <neilb@suse.de>
Wed, 11 Dec 2024 21:47:05 +0000 (08:47 +1100)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 6 Jan 2025 14:37:37 +0000 (09:37 -0500)
commitb5fba969a2e445e2f36b699582d8410478a99374
treea626b94a2d875b94446ec04d25ff686dca81aa4a
parent0b6e14242630ad5f65839b23400bd67c5166e2b4
nfsd: remove artificial limits on the session-based DRC

Rather than guessing how much space it might be safe to use for the DRC,
simply try allocating slots and be prepared to accept failure.

The first slot for each session is allocated with GFP_KERNEL which is
unlikely to fail.  Subsequent slots are allocated with the addition of
__GFP_NORETRY which is expected to fail if there isn't much free memory.

This is probably too aggressive but clears the way for adding a
shrinker interface to free extra slots when memory is tight.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4state.c
fs/nfsd/nfsd.h
fs/nfsd/nfssvc.c