Skip to content

Commit

Permalink
sunrpc: simplify rpcauth_cache_shrink_count()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kaixiong Yu authored and Joel Granados committed Feb 7, 2025
1 parent f5d64ae commit c8c3fd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sunrpc/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c8c3fd1

Please sign in to comment.