Re: [PATCH v2 -next 11/15] sunrpc: use vfs_pressure_ratio() helper

Anna Schumaker <[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 <CAFX2Jf=8cDNmjUBCRE-n6N9khkRRrq0ABtsX4V=j830Mi1spwQ@mail.gmail.com>
On Mon, Sep 2, 2024 at 11:31 PM Kaixiong Yu <[email protected]> wrote:
>
> Use vfs_pressure_ratio() to simplify code.
>
> Signed-off-by: Kaixiong Yu <[email protected]>
> Reviewed-by: Kees Cook <[email protected]>
> ---
>  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..3d2b51d7e934 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 vfs_pressure_ratio(number_cred_unused);

Looks fairly straightforward to me.

Acked-by: Anna Schumaker <[email protected]>

>  }
>
>  static void
> --
> 2.25.1
>
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.