From patchwork Sat Dec 28 14:57:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yukaixiong X-Patchwork-Id: 13922373 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 B4D6DE77188 for ; Sat, 28 Dec 2024 15:02:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 437576B00A2; Sat, 28 Dec 2024 10:02:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E76D6B00A3; Sat, 28 Dec 2024 10:02:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2AEC66B00A4; Sat, 28 Dec 2024 10:02:26 -0500 (EST) 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 0D4616B00A2 for ; Sat, 28 Dec 2024 10:02:26 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id BC1AE46689 for ; Sat, 28 Dec 2024 15:02:25 +0000 (UTC) X-FDA: 82944682590.12.4C9493F Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by imf11.hostedemail.com (Postfix) with ESMTP id D270740004 for ; Sat, 28 Dec 2024 15:01:42 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.35 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=1735398123; 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=yeMO9gSIL4fzXSTMliquZkxn3Y7YCdemyrK1MmJh9HdwCScQm34Kd598e1Kq1j08rtTIXw XIYhuJ6IX5/B9ngidh9RIBiH2BMVT6smDb327DrOVAEYaehn5CIzej8q4/UKTjsSx1zDrm RfWaROTsZiX2qy3jUmDsq5E+CwKwop0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735398123; a=rsa-sha256; cv=none; b=YoOWx38heHO9/hhR7M1gRxRdHLXWl0o+FZi5jBTA/kZF+Sv6P8GNqHi+xoc/pRS7LuOkAP p7LTfeJDSecByF9szhoV16pmj1It6S1/Eq/zY6Kzy63Ey9vGYAQd4ZwzPyhFUYgTcGrcZx vZcVkWcR5pz7B4FLc1KrhcIrm/acEHk= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.35 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 szxga07-in.huawei.com (SkyGuard) with ESMTP id 4YL59v4h6Sz1T6K3; Sat, 28 Dec 2024 22:59:31 +0800 (CST) Received: from kwepemh100016.china.huawei.com (unknown [7.202.181.102]) by mail.maildlp.com (Postfix) with ESMTPS id D44201402C7; Sat, 28 Dec 2024 23:02:19 +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, 28 Dec 2024 23:02:16 +0800 From: Kaixiong Yu To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v4 -next 11/15] sunrpc: simplify rpcauth_cache_shrink_count() Date: Sat, 28 Dec 2024 22:57:42 +0800 Message-ID: <20241228145746.2783627-12-yukaixiong@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241228145746.2783627-1-yukaixiong@huawei.com> References: <20241228145746.2783627-1-yukaixiong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemh100016.china.huawei.com (7.202.181.102) X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: D270740004 X-Stat-Signature: djncd3b73k4pqdw7ioagpiut9yezc5gz X-Rspam-User: X-HE-Tag: 1735398102-885968 X-HE-Meta: U2FsdGVkX1+ShiOL8Rb6nfqXzHEy7MDxSfHlC15Hfdcysl87nxreuy/DKfQOn8o2GZ4DI63ddalA6ihuEPtYksZsj9nnzEei3Dlda0WBi6RiEAFoAKMG2iNd2cbc4VSOyuvfpBYRvB9osblo6QaJLnkcLOAJdZiIMe36Sj8IaK7nzyNFrbMLz9KJeKq97sPkQSZoiAuPe+7iXJV14lr/qGr9Cv1WVK0wHUguU8pd/8I7I7h04r/qlfAqUx106BRtu57WVjXF2jkTdjMLYJnY9SpHYG83DJ4/7Fy3Mt4bH+9k5DwUaPDI0d0YurohMDs8ZnjlX7SAm9EB7gRtEbqV/5Eq9di+RzKvmT9PGzkUuH0/McgMmqkf9yQmRyUREn+sBq6lC7VNsKNwcNP95NqE0bDtorC44e1rQP9QXPisIkJSLVIgHyWSQ6BdqwwgZvmcWWSmYe5ZlQVrJFEB47J/iudgZs9P69RGmxvo/P9GJMq2iN0thlzN+G06V4ln04N59AH8M5e+CGuMIphpB1IAC/UWlOKNKl8r36vvZwMFpYOpd4Rn7pYtymoou2iIQZQBlgJLvgm9YhLpRXbDTKHvrjsi3mhOvfxdVZZ4Z20Z49B5UHxqJu2Fh8OtOTl3jn1d5Vgvou1fERECXSoYFeim2Oci9OU+80yUzGVD1wfsktIcyVBLWXsZMldEEpH/HEZH4IU7EFP13eTVwblNSBmI+v1Qh5BABm60W/gHdvznwmZjqvEyHa1nRfuBTtpKZ5l9UxNr6b0QmYlag6sbGzchuf9yjHr4Cg1phfygBUyLBTMzWdjrDeGHHEnnnqSXeWof07K4/aH1humeqKa0OHGZdWErqyZ3W4nq+L/brxeyEp4SRbHi/9fLZSmTC6n1oy1cagogiBaZ3B7S04Tv4N69VobJyFLWmc35OqZYW1nOYco4jriEExMKJrtOfvvnr4mQ3t5DwV0aUDMq+/8pxnb MyTF8QOn Tk4zLeA5ilUJj8UVACGwS+usNC00UM07D6E21LeCBwPEf/YfNO2pXfl9r6/0jRG0rY4/b+CMZAu+rX8BV4xI2/2Z2osge/FqMwxylYPDfx13celFRByNYeQAsPNSIT/dttpdsywdljjF3eAcspTH+T/fHnn7Xs1CYjXI1vTN185fjRiG46kER5UGLiauQ9nzhcQwf261PuOxNAE4YBHgFiha9ATNiKl5LcTH8OQMbiP7GTmkH/TEKEpV9WstzoPHo0s/TWeGlFNpZTDF5+rcgclhgIlISVri5AfBU1K5yC9b9vIhoe1GdlX3U2ZKiXYBNcYZKg+6ND8FBhr5euHN0DhkNJ6sSxBIOC/7Gtb41PyKqpyn+r0/95F2dKx2K2H2tF7faCKxnrAQVIuo= 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