[-next,6/8] blk-iocost: change div64_u64 to DIV64_U64_ROUND_UP in ioc_refresh_params()
Message ID | 20221128154434.4177442-7-linan122@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5748873wrr; Mon, 28 Nov 2022 07:26:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf7iUbc1lUkd3q7bAUGBCcxMUkEWCrt11lRERMtcthPdF+rra41ma5p+E1KLf3wf5g7VY2Gl X-Received: by 2002:a17:906:99cb:b0:7bb:7dda:7d3c with SMTP id s11-20020a17090699cb00b007bb7dda7d3cmr18594049ejn.182.1669649178915; Mon, 28 Nov 2022 07:26:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669649178; cv=none; d=google.com; s=arc-20160816; b=KVsFYAb7fdhHY44qsVIAlXTqdeutgRnwoHkevXDncyj8/EynYrvinX+NZqt3ItfLbg /CMXo2w6hbeu+o3E+ErU4Ohqt+ZQumRvxJfaq8vX9PW3ycwQqjoZToY/hbUbR+eigshp SnnIPdlLCl/jDEpMuNL4grDaIMP0xF0jFxpxD7fWdAAoqQE49CKAqCSFWL1qjruLp8kj 4aauaKy3eAi80bF0+3SnVGlGlKirhMDb2K0bPBQf0czSjkuUcr5P9J9C1AyljMmXQ9ZJ wO03lqVWqBqYJnBPOlWaSzgQHKWsdBoZLDCYp1bo0zca+nJcz/OW0LjWiga6WQfA81e6 DbqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=WN1SHVCvMATqQJTDI3M8RzmIRukUZ6cM6N64GeMM1zo=; b=yhEEUSFcNdOHX2ekYA5gQERH/wuWm+jVffSAtn5+LJUH4ekXO/PKNery3zHIW/QJR4 UkFKcqC5v+1QPoukQhZ2XSqVTslQQEW2kUEoCi5DGK0RYaOz31cRekJ35p8bz/kDJdi0 ACWP8F1+O6/IK4RX+Zyy8zTYVTTLsiU/XRLj0IAwgsOorY7q0EKQeB3BkA9P2X4zA5+Z t01wc0XzYlud3J4LOI8FXSXsjduVE4h3RI1QW1WyHDAJdqxqbSwbUAD4ETCeKq6ej2hj V84GZgoA8fUtpgTeHYnDkaQgDFjY9PjnWhZldtaVK4TSjs+3hPEaKRqePjSPENwgdDXq ACig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g3-20020a1709065d0300b007878c9d73a2si11281171ejt.426.2022.11.28.07.25.55; Mon, 28 Nov 2022 07:26:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231984AbiK1PYH (ORCPT <rfc822;gah0developer@gmail.com> + 99 others); Mon, 28 Nov 2022 10:24:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231651AbiK1PXe (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 28 Nov 2022 10:23:34 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C38B325EA; Mon, 28 Nov 2022 07:23:33 -0800 (PST) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NLTf902d3zqSkM; Mon, 28 Nov 2022 23:19:29 +0800 (CST) Received: from dggpeml500003.china.huawei.com (7.185.36.200) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 28 Nov 2022 23:23:29 +0800 Received: from huawei.com (10.175.127.227) by dggpeml500003.china.huawei.com (7.185.36.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 28 Nov 2022 23:23:29 +0800 From: Li Nan <linan122@huawei.com> To: <tj@kernel.org>, <josef@toxicpanda.com>, <axboe@kernel.dk> CC: <cgroups@vger.kernel.org>, <linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linan122@huawei.com>, <yukuai3@huawei.com>, <yi.zhang@huawei.com> Subject: [PATCH -next 6/8] blk-iocost: change div64_u64 to DIV64_U64_ROUND_UP in ioc_refresh_params() Date: Mon, 28 Nov 2022 23:44:32 +0800 Message-ID: <20221128154434.4177442-7-linan122@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221128154434.4177442-1-linan122@huawei.com> References: <20221128154434.4177442-1-linan122@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500003.china.huawei.com (7.185.36.200) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750754057381427773?= X-GMAIL-MSGID: =?utf-8?q?1750754057381427773?= |
Series |
iocost bugfix
|
|
Commit Message
Li Nan
Nov. 28, 2022, 3:44 p.m. UTC
vrate_min is calculated by DIV64_U64_ROUND_UP, but vrate_max is calculated
by div64_u64. Vrate_min may be 1 greater than vrate_max if the input
values min and max of cost.qos are equal.
Signed-off-by: Li Nan <linan122@huawei.com>
---
block/blk-iocost.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/blk-iocost.c b/block/blk-iocost.c index a4fa17ebb2fa..03977385449f 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -926,7 +926,7 @@ static bool ioc_refresh_params(struct ioc *ioc, bool force) ioc->vrate_min = DIV64_U64_ROUND_UP((u64)ioc->params.qos[QOS_MIN] * VTIME_PER_USEC, MILLION); - ioc->vrate_max = div64_u64((u64)ioc->params.qos[QOS_MAX] * + ioc->vrate_max = DIV64_U64_ROUND_UP((u64)ioc->params.qos[QOS_MAX] * VTIME_PER_USEC, MILLION); return true;