From patchwork Mon Oct 17 18:13:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roesch X-Patchwork-Id: 13009240 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 C6279C433FE for ; Mon, 17 Oct 2022 18:16:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6334A8E000B; Mon, 17 Oct 2022 14:16:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 596218E0007; Mon, 17 Oct 2022 14:16:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 39AEB8E000B; Mon, 17 Oct 2022 14:16:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 1E7D78E0007 for ; Mon, 17 Oct 2022 14:16:52 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id E604D8034C for ; Mon, 17 Oct 2022 18:16:51 +0000 (UTC) X-FDA: 80031247422.13.8F58A86 Received: from 66-220-144-178.mail-mxout.facebook.com (66-220-144-178.mail-mxout.facebook.com [66.220.144.178]) by imf30.hostedemail.com (Postfix) with ESMTP id 88CD480033 for ; Mon, 17 Oct 2022 18:16:51 +0000 (UTC) Received: by dev1180.prn1.facebook.com (Postfix, from userid 425415) id 4A81139C99C8; Mon, 17 Oct 2022 11:13:56 -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 v2 11/14] mm: split off __bdi_set_min_ratio() function Date: Mon, 17 Oct 2022 11:13:34 -0700 Message-Id: <20221017181337.3884657-12-shr@devkernel.io> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221017181337.3884657-1-shr@devkernel.io> References: <20221017181337.3884657-1-shr@devkernel.io> MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; spf=neutral (imf30.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666030611; a=rsa-sha256; cv=none; b=74pYL9ER6JgW9qDEjjF7jIEI/prso9BS2q03tfSXBsYYJHWZF2dUa9ptslmQg32YpNM2bQ no9dsxcZluu/sh/jaBDSCWRm6aCZShwO+ZxZPoXMqTssjnpfredfDWO6C9zZXlZg6jWk1+ +MkTMxxV9jmpu6CQGR+uQT6V/ne2UUs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666030611; 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=qA2sGZAUrL5QcVJP8dGva/x8lsWyQlXdSXfP5X3WaNDJjG6+okBF6S+d3LXw/uiOErPyg4 bP8z6tWnR++qUkmL2WdcLb3IkySi0ofklUNe7vOjRIb4CebBMNVx4AvgM/GrQLwmNv+T21 kLwCtFrfLLJssWZm9hzdbEgJYeZJXR8= X-Stat-Signature: tn866gspru7jtn58ob7z1b4i8ze51cw4 X-Rspamd-Queue-Id: 88CD480033 Authentication-Results: imf30.hostedemail.com; dkim=none; spf=neutral (imf30.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-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1666030611-147509 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, 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)