From patchwork Sat Nov 19 00:52:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roesch X-Patchwork-Id: 13049482 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 15F0AC4332F for ; Sat, 19 Nov 2022 01:45:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A87F28E0002; Fri, 18 Nov 2022 20:45:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A38518E0001; Fri, 18 Nov 2022 20:45:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9272A8E0002; Fri, 18 Nov 2022 20:45:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 81A928E0001 for ; Fri, 18 Nov 2022 20:45:45 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 55910C051A for ; Sat, 19 Nov 2022 01:45:45 +0000 (UTC) X-FDA: 80148500250.23.122BE8B Received: from 66-220-144-178.mail-mxout.facebook.com (66-220-144-178.mail-mxout.facebook.com [66.220.144.178]) by imf25.hostedemail.com (Postfix) with ESMTP id DB1DCA0011 for ; Sat, 19 Nov 2022 01:45:44 +0000 (UTC) Received: by dev0134.prn3.facebook.com (Postfix, from userid 425415) id 788A819380DD; Fri, 18 Nov 2022 16:52:18 -0800 (PST) From: Stefan Roesch To: kernel-team@fb.com, linux-block@vger.kernel.org, linux-mm@kvack.org Cc: shr@devkernel.io, axboe@kernel.dk, clm@meta.com, akpm@linux-foundation.org Subject: [RFC PATCH v4 11/20] mm: split off __bdi_set_min_ratio() function Date: Fri, 18 Nov 2022 16:52:06 -0800 Message-Id: <20221119005215.3052436-12-shr@devkernel.io> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221119005215.3052436-1-shr@devkernel.io> References: <20221119005215.3052436-1-shr@devkernel.io> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668822345; a=rsa-sha256; cv=none; b=lM/uUsV1uxsrWTS5p4zrrp1WffZMRuEitWyGVC5YwkdEOVsbrHizvKcFYEoxI0P5LfOjSu Fnu3wLi95/UNACx1ip/2fl6Edi7j/BGILAs/UiJ+CG5Bjo6FpP3jPSNRkYkMdS79i7TemL 9eB8LrjKGBaFg9TsjZxj0Ilh/xt0PHE= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; spf=neutral (imf25.hostedemail.com: 66.220.144.178 is neither permitted nor denied by domain of shr@devkernel.io) smtp.mailfrom=shr@devkernel.io; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668822345; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XdhPpcj8l6uajS15RCTLwqW9pJiDkrcFzzYl5EPgqtw=; b=pNGcb4DNd3w/MtMy+g71/P8BF9DQt54+SjqocQ82SgyRrp5Hg0aG5jn0FJJmjIf1yGrAA5 C0ezwNHokYs1Fgms5IIr4zWfzPpFWa3co2zIwCBDGwYYWOL2kg5Jgd0XMbHqzP2oWgFDeX qiwH1BugqCEMpND0EUsqA8Hh7eHQbJE= Authentication-Results: imf25.hostedemail.com; dkim=none; spf=neutral (imf25.hostedemail.com: 66.220.144.178 is neither permitted nor denied by domain of shr@devkernel.io) smtp.mailfrom=shr@devkernel.io; dmarc=none X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: DB1DCA0011 X-Rspam-User: X-Stat-Signature: 371mfwkz51jnuwessr6e8iftoetof4b9 X-HE-Tag: 1668822344-328494 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This splits off the __bdi_set_min_ratio() function from the bdi_set_min_ratio() function. The __bdi_set_min_ratio() function will also be called from the bdi_set_min_bytes() function, which will be introduced in the next patch. Signed-off-by: Stefan Roesch --- mm/page-writeback.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index c47824464f4c..cefee7210d83 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -685,7 +685,7 @@ static u64 bdi_get_bytes(unsigned int ratio) return bytes; } -int bdi_set_min_ratio(struct backing_dev_info *bdi, unsigned int min_ratio) +static int __bdi_set_min_ratio(struct backing_dev_info *bdi, unsigned int min_ratio) { unsigned int delta; int ret = 0; @@ -731,6 +731,11 @@ static int __bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ra return ret; } +int bdi_set_min_ratio(struct backing_dev_info *bdi, unsigned int min_ratio) +{ + return __bdi_set_min_ratio(bdi, min_ratio * BDI_RATIO_SCALE); +} + int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio) { if (max_ratio > 100)