]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
sunrpc: simplify rpcauth_cache_shrink_count()
authorKaixiong Yu <yukaixiong@huawei.com>
Sat, 11 Jan 2025 07:07:46 +0000 (15:07 +0800)
committerJoel Granados <joel.granados@kernel.org>
Fri, 7 Feb 2025 15:53:04 +0000 (16:53 +0100)
It is inappropriate to use sysctl_vfs_cache_pressure here.
The sysctl is documented as: This percentage value controls
the tendency of the kernel to reclaim the memory which is used
for caching of directory and inode objects.

So, simplify result of rpcauth_cache_shrink_count() to
"return number_cred_unused;".

Signed-off-by: Kaixiong Yu <yukaixiong@huawei.com>
Reviewed-by: Kees Cook <kees@kernel.org>
Acked-by: Anna Schumaker <anna.schumaker@oracle.com>
Acked-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
net/sunrpc/auth.c

index 04534ea537c8fd15082a2c5b23b02472f9175c3b..5a827afd8e3b21b79dece46c015e1d7db5e26659 100644 (file)
@@ -489,7 +489,7 @@ static unsigned long
 rpcauth_cache_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
 
 {
-       return number_cred_unused * sysctl_vfs_cache_pressure / 100;
+       return number_cred_unused;
 }
 
 static void