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: 13787990 X-Patchwork-Delegate: kuba@kernel.org Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBADC1D54F3; Tue, 3 Sep 2024 03:31:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725334293; cv=none; b=LZkqHEXswWnepIidlIKr5ZI95dFeA9SYoOxRs+GPnT62G4TakQ2e0kkokg+18R5n9gyjJBI5tDzCc0l5zAG5skPNbTpj1reG4NeaWmtGfiIxGYTewGfcRWJf9BSpAhmAQEld5ZpJy+le5FrYswIisAMlm8tu2zP0JyOWuKpTfEc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725334293; c=relaxed/simple; bh=vuwW7woV5xLvgdxAnZPoigZYCJ0tpERdDt+arrilGb4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KF5w8oisF5r3Ev4saA8ZWEgJ2HpWYl55UWXmJ2wLUVkjJzzRCRRbPuOeGezHDUNJj0B8GTMtVRRelgS8a1YSt+PI/AbCDRJLJC8UxamV+Cg5GTuqH+cxBRAsd2S9VmU3/r5bqCYQr0RMkDgRY7X1Ewnw1dcaxoCLwxhOKoWcQaI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=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> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemh100016.china.huawei.com (7.202.181.102) X-Patchwork-Delegate: kuba@kernel.org 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