From patchwork Sat Jan 11 07:07:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaixiong Yu X-Patchwork-Id: 13935842 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 2ABB4E7719D for ; Sat, 11 Jan 2025 07:13:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B43726B00AF; Sat, 11 Jan 2025 02:13:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ACAF66B00B0; Sat, 11 Jan 2025 02:13:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 96DA76B00B1; Sat, 11 Jan 2025 02:13:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 765DC6B00AF for ; Sat, 11 Jan 2025 02:13:02 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1D08CADEAA for ; Sat, 11 Jan 2025 07:13:02 +0000 (UTC) X-FDA: 82994304204.13.04DC648 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf12.hostedemail.com (Postfix) with ESMTP id 0BA1A40003 for ; Sat, 11 Jan 2025 07:12:59 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=none; spf=pass (imf12.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=1736579580; 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=sbKE4OSMhkwyZzXHfmRWq1GAsNH4bgSZ8MnE9NstNhU1A1KwRXBf3pJw1za+h6LaMM1iz8 L0K//kRIjQKHrUaHwB3N/xmPDtULaDT7a7mXpkayRRLPKO3KIG0Fyc2jXB7mPVf+/5TGbv elUyW1EdLC5tS67Kgs8Mch+9DrlD9yI= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; spf=pass (imf12.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=1736579580; a=rsa-sha256; cv=none; b=4qUdArYcL+Id5SDXiZ348K6EyXS2DvTi1cnTw+h3oNVc9ms8COiZYjZtv7fIzNRxhlJ9Xp 84a189rsNszmV2vUuWNghmTb4UpcXM8DWvjSIGSsTTwOSy44SXEQY7ziqO9GFPQe74GopU sVgEQoI7eRZpvyb5/+Op+wqXyD0+Mrw= Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4YVV781PtbzrS4W; Sat, 11 Jan 2025 15:11:16 +0800 (CST) Received: from kwepemh100016.china.huawei.com (unknown [7.202.181.102]) by mail.maildlp.com (Postfix) with ESMTPS id 30F2E18010B; Sat, 11 Jan 2025 15:12:57 +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; Sat, 11 Jan 2025 15:12:53 +0800 From: Kaixiong Yu To: , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v5 -next 11/16] sunrpc: simplify rpcauth_cache_shrink_count() Date: Sat, 11 Jan 2025 15:07:46 +0800 Message-ID: <20250111070751.2588654-12-yukaixiong@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250111070751.2588654-1-yukaixiong@huawei.com> References: <20250111070751.2588654-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-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 0BA1A40003 X-Rspam-User: X-Stat-Signature: 6owbhg3snakm9gd936yu1oaeafb1jue1 X-HE-Tag: 1736579579-987622 X-HE-Meta: U2FsdGVkX1/SDr9jCxT0QW42yjry5j2/9WEtxeThvqHGW9UvMqVv8pXeMqeIazgDRiCS+9/IIdMeWXPo9PHtFSS/ZyMVWy8fMk/JToc2vgy7GwfDUDh/K5e7fuI37imxlVWTAnGEDhBsHnrWX+p/ldhwFRVkma0I56C/rKdQ14Y6zWUCIrS+mthnu6ezIHIgY8iceNanH3u7iYKAVMb0KBepyUIJSm+QtG82krVScx8uFnpddypfCLUeJzpocaDFKuDjelaR4UOXlw4DPQKnaIp2zKYoBa11PI1t/r9LktTKuFNsVXZVYVoUfkHnZSat3eSYgiRrBpMEIHSpfjNCHvyZfwjNuT3IMk3uI0Z+TNfKXNymw/6OxExoJERpdJ8Oou1AFov+USOe9eLPlsjIIOMSWqo/1RMBOoMyyvxpQswNmH5nIn+GkN01C7I5Fzua8pJL8bcIk/DRY1kWXe118AX9DCTUK0wraBMyvHUXGPkELHSQDSrCJRkSG50FojcF4M5xRkRbb1z+PRTBaedLDhVKC8ReMgFwLJRp2Q3Jp+dqrzNjjQ4g98q8A4hH+JwrdHgtegVgVDcDYegMuzuGoiEA5fmalSNyGbViBfiRSjnN8TDJexUxlVgilzNUt1jlwcn/s48Pwy6DcMFhahgTLkHofN2ZArZge3W3niJvOOI69+tHsqir9ti3gl74TjNiTfrVSKD4u5HfYiM0RJkZHOvvk9S+Y713aGz5R0KPEdhw7QLlta7XJfoZRwLTi0ip2lUBLD2WF9frqWhanyY17kWk3JyUkmLU/Tm5Q2fLIH3FPOrjoaZr9kgfO5GnTL3P08dvb+pQXolg61A7TvPuV+DNHJCQQq23LnTzjh1jSHg/mNeV83RurjFNbdES98hcwHZK/B/t6v3w/NLwP5iv6xa2j4vX4v/vNzVCr3eC2VosGyEMUj2pBuY6EIBfiNJotjYPYDvhbJPx5d7/9vP GXlj9t0P TqgJ/4ahj7lmK/NKZ+NACsp7KDuDeisP3MYX8Qc/FEW5QB+3sLD4bEeMKlyeuof6yq5SemS7x88rKMa8ORrM+/7XtnnBsdIqQ5RXA2Um2v+PtFgL++QJEo1frn1uBKE35/qw7NHJ1wk6wdHNrz2tOWqbBJWd/G6JNNpKyVZEZnH3FhhVyTmqLNtIqQ0nnLsQVDoLizmmFrHDSgxGi3AbLq63tvVgFPUDP7vGtM61ssdOIv27sdi28iXEQ/1GhaRYNRMrZA/f8KQKe9XcJ7hPFO3UDCmgAamGWwz+ADvMlJOhh8CLoWCmqfPy+Yf+EXoXgMnNOKEcylUbO2PvCVqnQ5HG8UaqSWEb2VSMjwKNtMcqd5sMrt9l4hP1nee0UKPyYm24ZaHLPI6/oj1s= 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