From patchwork Tue Oct 11 01:00:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roesch X-Patchwork-Id: 13003488 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 0424DC433FE for ; Tue, 11 Oct 2022 01:01:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F126D900009; Mon, 10 Oct 2022 21:01:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E70E7900008; Mon, 10 Oct 2022 21:01:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B1DC9900009; Mon, 10 Oct 2022 21:01:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9A3C2900005 for ; Mon, 10 Oct 2022 21:01:29 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 5591DA5069 for ; Tue, 11 Oct 2022 01:01:29 +0000 (UTC) X-FDA: 80006865498.14.266A00E Received: from 66-220-144-178.mail-mxout.facebook.com (66-220-144-178.mail-mxout.facebook.com [66.220.144.178]) by imf06.hostedemail.com (Postfix) with ESMTP id BB14A180016 for ; Tue, 11 Oct 2022 01:01:28 +0000 (UTC) Received: by dev1180.prn1.facebook.com (Postfix, from userid 425415) id 29E2634BDDE4; Mon, 10 Oct 2022 18:01:06 -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 Subject: [RFC PATCH v1 11/14] mm: split off __bdi_set_min_ratio() function Date: Mon, 10 Oct 2022 18:00:41 -0700 Message-Id: <20221011010044.851537-12-shr@devkernel.io> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221011010044.851537-1-shr@devkernel.io> References: <20221011010044.851537-1-shr@devkernel.io> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665450088; 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=teDNe1Ua7LbxZMqlEBzF6LNgDM/LSr7KGIqwPnX0YBc=; b=xkV7yuFrCsua3L1uDlP/X2h+8mFejw7WNS9k6NDf+a9J5BFwVpc+7oL1uGPPcNkT6G0HqV 11Vgbvv//QLPinRLTtBsso9kTSATb8BGtFSHmMdtQaXHlxl7FrkzfFLxtjs7sIIYhgTHB4 EiSzWfh0hyUNqmDx1torLJYct5uDaDM= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; dmarc=none; spf=neutral (imf06.hostedemail.com: 66.220.144.178 is neither permitted nor denied by domain of shr@devkernel.io) smtp.mailfrom=shr@devkernel.io ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665450088; a=rsa-sha256; cv=none; b=zt5iX61VakGTL0Xg+sWIWILDSsBJOtwNJIjwrs/0jHf1chMx+6yvYyfyn26hjF6poATYNm AV11Q6OQMOGVQBz4BjUwjxrAZ4/Y3G/GQA2nN5MClUTiTgYboo7t8vgvmVgtBiLNDg0kos cbm7hm8W3k6AMUfCOA+wzbOaOcq1cqc= X-Stat-Signature: ubwrwas3ha96nhbpbpxijztma3cdrkcw X-Rspamd-Server: rspam09 X-Rspam-User: Authentication-Results: imf06.hostedemail.com; dkim=none; dmarc=none; spf=neutral (imf06.hostedemail.com: 66.220.144.178 is neither permitted nor denied by domain of shr@devkernel.io) smtp.mailfrom=shr@devkernel.io X-Rspamd-Queue-Id: BB14A180016 X-HE-Tag: 1665450088-27200 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 a37a25994ad8..7733dcf96d7e 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -684,7 +684,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; @@ -730,6 +730,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)