Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15045145rwb; Mon, 28 Nov 2022 07:27:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf6JPjKYXnO9DQHwhYHcxmjMgsLTz8ISgEqpFzcuBag6BqnzPoOu2fV35kOG+tzTmzuS3o0y X-Received: by 2002:aa7:cad5:0:b0:461:948e:55db with SMTP id l21-20020aa7cad5000000b00461948e55dbmr48281087edt.131.1669649252661; Mon, 28 Nov 2022 07:27:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669649252; cv=none; d=google.com; s=arc-20160816; b=VPgaGfqFB/NXFjK6he0xbk393YyPB10AbBfyjrj7VM/rXgwMQqDTQwIvHkVf5niu3/ Pia7W6NvgMXO6A4VBagL78lURUzdAcQXOkjYVMksH2ZgA9QFIEmqE6IM9tDf2UkiyUDC wNoDPQozmJL9VZgJNgqNDIdpbtwxnfZwf130X57SrBNaNkRh4O/Hyn8ZugUgSqRFDLlw kdn3Bd1upvmD4F0eHrAo3IMK4IsnFRt+7sjN55tvoHWLNuwqkLihRnejXgpP3HQ+rPJy rtb8OLy+/nlOdEIjRGMbpSjQs6am7BuWomKQVK0wbbsVI+gmQ4OZ8XUDAa6M0m/vsTsM QujA== 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 Return-Path: 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.27.12; Mon, 28 Nov 2022 07:27:32 -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 + 84 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 ); 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 To: , , CC: , , , , , 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.31.1