From patchwork Mon Oct 24 19:06:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roesch X-Patchwork-Id: 13017993 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 66A99ECAAA1 for ; Mon, 24 Oct 2022 19:06:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7C465940013; Mon, 24 Oct 2022 15:06:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7754294000C; Mon, 24 Oct 2022 15:06:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5A106940013; Mon, 24 Oct 2022 15:06:43 -0400 (EDT) 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 4634694000C for ; Mon, 24 Oct 2022 15:06:43 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 1929E1A0CE7 for ; Mon, 24 Oct 2022 19:06:43 +0000 (UTC) X-FDA: 80056774686.06.B04BD06 Received: from 66-220-144-178.mail-mxout.facebook.com (66-220-144-178.mail-mxout.facebook.com [66.220.144.178]) by imf09.hostedemail.com (Postfix) with ESMTP id 7D8BF140039 for ; Mon, 24 Oct 2022 19:06:42 +0000 (UTC) Received: by dev1180.prn1.facebook.com (Postfix, from userid 425415) id 879E23ED591E; Mon, 24 Oct 2022 12:06:12 -0700 (PDT) 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, willy@infradead.org, hch@infradead.org Subject: [RFC PATCH v3 11/14] mm: split off __bdi_set_min_ratio() function Date: Mon, 24 Oct 2022 12:06:00 -0700 Message-Id: <20221024190603.3987969-12-shr@devkernel.io> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221024190603.3987969-1-shr@devkernel.io> References: <20221024190603.3987969-1-shr@devkernel.io> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666638402; a=rsa-sha256; cv=none; b=vJpL6oKlr/AE+zdk4DhI9kQNaB0D26WulgNevRQC0b5SkHQXy02hCnaLG7m2z1do2ySD8p IuBC63IP/zgAQYbKkwbqgxPRLd6L0iz6Tnb0FRdw0pXgRd7d7u2RsVr0q6lBfE1q76T47g ypO3uKkkidFq5sBTJ/CGl0Ih4b8Ww+E= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; spf=neutral (imf09.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=1666638402; 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=IZ7bEncvwhyJc9EF6wrS1C/KziMYTcD+EWx1LHFw9XY=; b=y8J8w7GgrzWb3pElbW1duGEA2fzr8Dp49pB2yVbJuBZB3RfRjPKsh2cROWltRJT5zpewdP f8c3u3UG40wuP7L2qXAIifXolHEWmS41HeoCQm3UcFzpN3C0kL9n2X84smk8G2BDwSZJaK dzQKN5s+XnLi9YU49VyY879aVX/5irY= X-Rspamd-Queue-Id: 7D8BF140039 X-Rspam-User: Authentication-Results: imf09.hostedemail.com; dkim=none; spf=neutral (imf09.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: rspam04 X-Stat-Signature: cx8ha911qw7pg4n6fpq71mztd4bh7uh8 X-HE-Tag: 1666638402-455767 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: 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 69fc2866e625..07f59ed60d4a 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -685,7 +685,7 @@ static unsigned long long 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)