From patchwork Tue Sep 3 03:30:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yukaixiong X-Patchwork-Id: 13787960 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E377DCA101E for ; Tue, 3 Sep 2024 03:31:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 13C8B8D0131; Mon, 2 Sep 2024 23:31:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C4CE8D0119; Mon, 2 Sep 2024 23:31:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E7FCD8D0131; Mon, 2 Sep 2024 23:31:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id CC0E68D0119 for ; Mon, 2 Sep 2024 23:31:35 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 85AC6AAB04 for ; Tue, 3 Sep 2024 03:31:35 +0000 (UTC) X-FDA: 82522002150.19.F6B394E Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf02.hostedemail.com (Postfix) with ESMTP id 60D2A80005 for ; Tue, 3 Sep 2024 03:31:32 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; spf=pass (imf02.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=yukaixiong@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725334198; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=N3NvLzAWMi5td0cMRJ65bdLAyhA5wt/Ciq2d5iq/wFM=; b=v1Ugu5fiyHNCwuOGExM5He7OXoDFIGD9VZhuTxem+bxltZZrEaPwpfg4nSP6GI9fAX3QIc mDgWps2Kd9gq03P2mprS8bvH2TwkR7m0pLDrwm3Ib80s4Q12rbAfGRsj43Pa09LWNnFGqI TuRhGjBKO9004c9wBMwiTMPObhxqScI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725334198; a=rsa-sha256; cv=none; b=5gyGJYeb3YBCeLXGCNgfQ/v6N8Ameue2S2iy7f3wxRxm/2dfrN1iSKnBqvzzi0G3PpKrdD OKWB4XK25DdS3KhF+f5LqQItTJW3KsWAMH0RLZvEvtN0PBkzbMCdwF99C356VnXEPC69OC KhaPlGJNE2HTVwN7T2VgUC/JuRY9mqg= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; spf=pass (imf02.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=yukaixiong@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4WyWPB00lCz1j82f; Tue, 3 Sep 2024 11:31:09 +0800 (CST) Received: from kwepemh100016.china.huawei.com (unknown [7.202.181.102]) by mail.maildlp.com (Postfix) with ESMTPS id 72CE51400D7; Tue, 3 Sep 2024 11:31:28 +0800 (CST) Received: from huawei.com (10.175.113.32) by kwepemh100016.china.huawei.com (7.202.181.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 3 Sep 2024 11:31:25 +0800 From: Kaixiong Yu To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v2 -next 11/15] sunrpc: use vfs_pressure_ratio() helper Date: Tue, 3 Sep 2024 11:30:07 +0800 Message-ID: <20240903033011.2870608-12-yukaixiong@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240903033011.2870608-1-yukaixiong@huawei.com> References: <20240903033011.2870608-1-yukaixiong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemh100016.china.huawei.com (7.202.181.102) X-Stat-Signature: rp313mkwm98zoeba144nd7rza5z77phx X-Rspamd-Queue-Id: 60D2A80005 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1725334292-535712 X-HE-Meta: U2FsdGVkX19IcVDYyZa/QP/K9NfYxZ2nIKbqljucBZ2BC1GFdzak5Hd4vgp42/SV93XQaphKikw5CyYZ4dqj0MFxaHDfPcYRBVqZCqgmlThtcDQr6fx+WQ04slQsnmGVx+sPxYU2Mf3jTtPUalUqDkSYNV3p890lIR8xRjskeHpbeeyx0VL/Ft9BrfqmLsDiqxYod8o/wTdgKwwk4z+B9GrBEjSTGV98nF+hDN4L0/89QRYEMm6oMW0PxswVyLtY3Ui9dbnLmiHZXTuZoCDmsjDTWQlRgZN/ijovSqrjwxSxoyx1Cy38snOwOHKHpMp+QB0aOqRd20VwftomUs0kOQx0EE986N7sci3+6qADrPy0IJXfqBhG7F8Ox5m0Tps1HjAgknVLXT6HdHTfBb87kUc73a2cEQsAI+FRZsoBbIjCHP6MgTOKYuY0QlQH+1KgVB8YzRvk/gfYDiqAfBrIXaJ/XTicLenofD2X1cqSOgUWMlZNTpvWPSGW/QJHtnNRWU8M1VGnlXVKh0/AvYjCzdVTmGBlDK0DKnryNVF8h4c6cKwRyyu8+ndUWgrr5PgDqx3wNgZv+hgzw49d1w9bvS4s9t+EWrydSO/5tnvIPE0J6yOvvXv7evF9Nj/+9zhNumrRIPaVifVRoyobsu2tWalpzI6vGvPNqjtCtcpNdrs3jBHyMGnBT/CMqKgBiFyj5AuTK1FQ9pESZg6o0lFM4LQTQYK6/zxW7oCXRFhe2YdekluevB9wXG7t8PJOwTXJnY/HcgzF/8PuDddqKKSgyrZCWDi84K5nhLfsMhzbsrEipEw9Ib1+AwoaW7Ip8W7AW5i7Tm/SQSex3nvHwxXcQLAtxRAwemYoIXkKC7EZ2QXApZ2FmaNSclF+7CK6iavwy84XOpuw0FoET3hGQsDRSBDQYoyhpCxQNBohyWr4rNEk5051Iag5YNcYGXDmKpi0WWy7e7d2b8ms1xyWCPI idYlqS21 GhhQBdFWamv1i70u44GZ6nJerafV3hL6jZ8g8DOgqrqf2+qqP4Y2VPiaVjcdo2+RoFlRJ8OfZ5h6s0wUk5wKOmH2N7jrbiUhMUmUlkK96bG6OTDW7KYYBYkPuLQzGktiNz7kreUjO2AhCvgismvqnDtOjtLl1nrEMfCvob/lhvaH/rTY7VJqX3yrhDpl0N+2Bu08uqSuZkg6bBh+izeJAUGNi5P5LebopvxUZXQ86Y6lK7bPykvO9hFvHGw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Use vfs_pressure_ratio() to simplify code. Signed-off-by: Kaixiong Yu Reviewed-by: Kees Cook Acked-by: Anna Schumaker --- 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); } static void