Re: [PATCH v5 -next 11/16] sunrpc: simplify rpcauth_cache_shrink_count()

Joel Granados <[email protected]>
Newsgroups gmane.linux.ports.sh.devel,gmane.linux.kernel,gmane.linux.file-systems,gmane.linux.kernel.mm,gmane.linux.nfs,gmane.linux.network,gmane.linux.kernel.lsm
Message-ID <cvhm3wxsuzptwhensumidxykuzgzzhp4u3ypwv4sicmssznxzk@xwfwpjclkzrf>
On Sat, Jan 11, 2025 at 03:07:46PM +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 <[email protected]>
> Reviewed-by: Kees Cook <[email protected]>
> Acked-by: Anna Schumaker <[email protected]>
> Acked-by: Jeff Layton <[email protected]>
> ---
> 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;
This one is not related to the "moving sysctls out of kenrel/sysctl.c"
but I'll keep it here because of the Acks received.


>  }
>  
>  static void
> -- 
> 2.34.1
> 

-- 

Joel Granados
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.