From patchwork Thu Oct 10 15:22:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yukaixiong X-Patchwork-Id: 13830202 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 2046BCF11F9 for ; Thu, 10 Oct 2024 14:12:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A03376B00A1; Thu, 10 Oct 2024 10:12:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 960B86B00A2; Thu, 10 Oct 2024 10:12:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 78CD16B00A3; Thu, 10 Oct 2024 10:12:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 56B0D6B00A1 for ; Thu, 10 Oct 2024 10:12:12 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id DA5361C41A0 for ; Thu, 10 Oct 2024 14:12:07 +0000 (UTC) X-FDA: 82657882062.18.DBF7A60 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf18.hostedemail.com (Postfix) with ESMTP id B76531C0014 for ; Thu, 10 Oct 2024 14:12:08 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=yukaixiong@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728569459; a=rsa-sha256; cv=none; b=bkgVbghyeAoRH6CfWcahgO8mIKQKWI7El0h2JxXbi+RgiPSu7rgcQ5hVWi2d0an6wczEjK 0wViVectNnLEupDaXp7LBCjnHOTz8bApsoy6nQrIAPvI3qZl395bK5WLLTffqqV9nhZjTl 3hqFLksRIxyIdOBRJFmQHzvu78OiYQE= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.188 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=1728569459; 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=qcFabJnSAPGDVVxpb7DwCXKyqXrGxesN6Jv4YQDways=; b=ZwpjhhZqv4oF6V5k6s/R7T9MydqoKzqFF/fnzeuhWxGizc96ET4PauMwAnT1Y0lEyO+0iT 8wQgBZ13/HDH0/obOcoIIA2gkNAZLX6rSERsmn31+mnbBnlb4/G+3sDSm5WPo2jHw4K2Df EusJ+CK+GMtxJVKSz/tU/nojh5t3lf0= Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4XPWps55PlzfcvP; Thu, 10 Oct 2024 22:09:41 +0800 (CST) Received: from kwepemh100016.china.huawei.com (unknown [7.202.181.102]) by mail.maildlp.com (Postfix) with ESMTPS id F30D8140157; Thu, 10 Oct 2024 22:12:05 +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; Thu, 10 Oct 2024 22:12:02 +0800 From: Kaixiong Yu To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v3 -next 11/15] sunrpc: use vfs_pressure_ratio() helper Date: Thu, 10 Oct 2024 23:22:11 +0800 Message-ID: <20241010152215.3025842-12-yukaixiong@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241010152215.3025842-1-yukaixiong@huawei.com> References: <20241010152215.3025842-1-yukaixiong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemh100016.china.huawei.com (7.202.181.102) X-Stat-Signature: tx3wt6wcyew9iyb4ruzx3mo1up9ob613 X-Rspamd-Queue-Id: B76531C0014 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1728569528-393664 X-HE-Meta: U2FsdGVkX1+GeFKFYCb37yHziUGctnf4/uSvpLzY++UA8b/La1yAoMLdhrzEXYTLJieWHW5VAqUTfbik2ZKggm/bqplGSkHgkTT5yG/sJRl50CONQnnnmzq79Ewlpi6byiETLA9BW6cU9hds2N5L6v2k/GJ607EI9OIwsdIUPMR/Ueeaj5JcdmjA6NuUqu/kbMQujHWwK+FIW/gNt/EVbVlgrEkfeNGXISP5JEpQJh8LHEREeKXbj1hZAD1pbxtPfwzRyvacZe+mOd6aEWZyxXOvDL30FQBOALTBlnxqF2RFH4g81Pu0K4G6w1pvwIVRoCVGdX7cM7rmQ15w4mGL3ofa0rMe/27f9B+y2CFQocrfZGz7bH6MMi1wZmZoGpXmW6jE8w7YBTi4mnwj7LjWtZalSCApc0tM68CwiY5Zpv/ImsFTppu3UBQxI29J1lxONXTBDwBRqwAABx5TH25j9FpG2aN/zHhlE6NG7OrZuvvOoZKLUPWCWLo55/O48oPccPTyFNnsbiF7lGCn7rpRgRKhABjDXX+/0x9KK6Rd4g5wxUbxsv/ShGF/FtWDycBGCA8Wt6l2Z1k2y5R1UzspDSk2Zecobqh9ZxS2dk074HeYr7b4HZcSjzM+to5Z1dHeM/Xrnp9CAWRZce3p32GO3ipPzkHKvl2FHqoKMQchQNqwVD6uBfAvReR+wK9v8ctH+WVQnpl1Zrp73iVqvy/VnHAdwv2K2QWgLBStvn/3lXJfYQAU1fFlfpIDvrn9IoCCA8TCOUeHkYx03/YE9AQBbC8Ts0oyk+WT5IaQpHeFUcIRyuxm9757uAC6O2gvflZa4uHBFCwP4BDvxFJ6g+UJyyAjAcTaiwJB4tNxqqaGLaQSPeftBbSerbsAZigwCE4LgO09mLwJfYJoou9OgDPjvt/Pj7zXFCX8ZVRn/rn4fOSZqojNxdEctlSJo/XgRkxvnpJexoXclRBSzM6ILpQ Icc4zh1V 4WAUtWxjGZBjBO5EV8KJpDsRsCl677JvDGjhOYMfLqwL1aI1APYeKcGcGtFpI/PcgGBj5iVx03ebdUO/QHx1xn7bIVclMjSuUx9ngRMwCtq6Hov1tvC6r2K1FzVONyiXHgjVmAnuls8EQR2Lsfl9pNZK0t1hZmb8+TDNuTv5xKnwMPkOsQepgpBVzfzfe8/zeP1NPWvRquxsrzXYA9v6pHW4mhEetafbQU8S1+RA5AwM80eQ= 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 Acked-by: Jeff Layton --- 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