diff mbox series

[v4,-next,11/15] sunrpc: simplify rpcauth_cache_shrink_count()

Message ID 20241228145746.2783627-12-yukaixiong@huawei.com (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series sysctl: move sysctls from vm_table into its own files | expand

Checks

Context Check Description
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

yukaixiong Dec. 28, 2024, 2:57 p.m. UTC
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>
---
v4:
 - Simplify result of rpcauth_cache_shrink_count().
---
---
 net/sunrpc/auth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jeff Layton Dec. 28, 2024, 3:11 p.m. UTC | #1
On Sat, 2024-12-28 at 22:57 +0800, Kaixiong Yu wrote:
> 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>
> ---
> v4:
>  - Simplify result of rpcauth_cache_shrink_count().
> ---
> ---
>  net/sunrpc/auth.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
> index 04534ea537c8..5a827afd8e3b 100644
> --- a/net/sunrpc/auth.c
> +++ b/net/sunrpc/auth.c
> @@ -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

No objection here, but this patch seems unrelated to the rest of the
series. Should this go in via Anna or Trond's tree?

Cheers,
diff mbox series

Patch

diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index 04534ea537c8..5a827afd8e3b 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -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