From patchwork Mon Dec 23 14:15:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaixiong Yu X-Patchwork-Id: 13918964 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 8726CE7718E for ; Mon, 23 Dec 2024 14:20:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B35606B00C5; Mon, 23 Dec 2024 09:20:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AE5CF6B00C6; Mon, 23 Dec 2024 09:20:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 95EEF6B00C7; Mon, 23 Dec 2024 09:20:16 -0500 (EST) 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 7522A6B00C5 for ; Mon, 23 Dec 2024 09:20:16 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2B6BCC1815 for ; Mon, 23 Dec 2024 14:20:16 +0000 (UTC) X-FDA: 82926432414.30.9420A9D Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf02.hostedemail.com (Postfix) with ESMTP id 249D780011 for ; Mon, 23 Dec 2024 14:19:00 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; spf=pass (imf02.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.32 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=1734963596; 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=nqyhYC9VHRbpINjzAU6rWoUpGKxiH+bHUC0qsLRtufg=; b=6eaSSAZWOzrSRVXg3yftXifi/Sn1qqodqqwVIznKMTbJaBxse1C+XEkhkpqs/aKP3mqref ot/KesjxRWJdvcGZvp7kyhQ/kpGhYFyk/B0DPSvFwSwC9WQOZpasPBcztdCA++mzT5W1M7 r0deEoGMHE2JDs0hhMEYL1Bu1KGmOAw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734963596; a=rsa-sha256; cv=none; b=Yy0I/9aZAPY4UMLL1QgjaacF4pvutz6+AIBLWIOqSp7ZpdX3NIlPKy1ALE0SdYKuAFugmz CuJp9F+QJgbD7xr8DdFube6FCsJlVFfEAyRqAg4328Xbp6xK88ILlI87TDRcmm3/3IjL8r OqOKLwkqtPWfMb4UQ/H866dxaJzrBtI= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; spf=pass (imf02.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.32 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 szxga06-in.huawei.com (SkyGuard) with ESMTP id 4YH0Y932FCz20mdY; Mon, 23 Dec 2024 22:20:29 +0800 (CST) Received: from kwepemh100016.china.huawei.com (unknown [7.202.181.102]) by mail.maildlp.com (Postfix) with ESMTPS id E624E1402DE; Mon, 23 Dec 2024 22:20:09 +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; Mon, 23 Dec 2024 22:20:06 +0800 From: Kaixiong Yu To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v4 -next 11/15] sunrpc: simplify rpcauth_cache_shrink_count() Date: Mon, 23 Dec 2024 22:15:30 +0800 Message-ID: <20241223141550.638616-12-yukaixiong@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241223141550.638616-1-yukaixiong@huawei.com> References: <20241223141550.638616-1-yukaixiong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh100016.china.huawei.com (7.202.181.102) X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 249D780011 X-Stat-Signature: zwos7gm8493tqj8h4xdxx6a7broijdo3 X-Rspam-User: X-HE-Tag: 1734963540-792716 X-HE-Meta: U2FsdGVkX1/kkGEaHDRWV8e9mjkPcUSg4UB3r3iqgs7Cm/69C5c4thHFnGRgF7OUHJ1Er+fpj5TAP+PyAJ7ZJTITh+gyLF/h7Cg7XtgCBt5abwQGn34u6Bxbo4q+XUUYLDWQXzWYrPpQvhSKf5jYhVTkc6wycJCyBDy2FWLyPP3EZLyBAnPlixSe2q92n3c88zgyAoi9LS4jBxetRmjC2+2K4jwvT8h3YLNBDxMvqIQjuHEbxT1Uovx4YWAW2L7lqRFMi9s4+onw4ub76LApiLLUbNCnTbdGnvJ6t/5alGZEwfGxrs35ZoUwnvq2D5nw7J7MUtuwf+MusHhMKA3ITiNiTWV0D8YCqGxxIGDq/RIkx3Li7i1gg7Lh2ooDJKgGIRn3pPXS9auGkIN0QRyWt352cn0UfojqK3Xrx/LurS+bHuRhoMVC6gRo9P6P/D6uDJYhJqYsHpMWOV9NXmUqiIZmqe5ppRZQSPq6efM+SeuXH2HBeK0wdSHqc9eKinkbJqHjtRkRcMTv+m53Jhpd8O/yHwcoCqAP5EY8G7QTjigGAAYVq/5fC2b8DqX3cz65zVYfg/ZIQxDTjpvPy9Y0hoDUhVWFs9js+cPyg4WDjBhPlJiIzfXIOZg7amWY6b876u4xpFpc8wxnry8ZLauYk/ZgpJP9yG8kjwLC6FpFADyknBRXqlaeYTNOiUlwdYbRE6GHWWZ0AKVfeg4Je1wNw9kZ9PZtO/v2t8kkabezpuKitkmhpKzUpYPWLXwx69Mitp4BdZ0hwLpYx8SpaYvVGFeuN5vr7YhkESI3O0avSarB52mxVT/otKdoyo91M7U3f0QvSB/rYN/PRm8nJFcjoQf4D19ixUy7qdlY9CV6Chhtews6ptzoQvndDTUAPO0MXGMWkQZaaM1s2cuWav8QMGj+tXOUtXuZXXQhrdc9uMxmbWute1Z3oLFSHGyDottaaG9c/Det+aSGxssY1uu t3KC/5zE dkBPTtza2vW63BXJBdBtOZU3CT2CPb7vF1b5QeNYfczJUVoDqs4lv2IAJ136uziwT1KcD3eA8JAaNoXCrN6aNS2tj9CO0eKdRmYo0J5+SmpAJCHhpYGDqSM9itk4bfkBSbZpTyOGP1vWfRp/Kd2VjRkRhSVEvC/QSGAdmJU2HH7rg7OHCs3mmmcmdOpSDVSHaxvVurNbTZzr/AJlsnaNvo7GGve4n6/VuDRjdo5wYEWB58NE= 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: 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 Reviewed-by: Kees Cook Acked-by: Anna Schumaker Acked-by: Jeff Layton --- 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