Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2335309rwb; Wed, 30 Nov 2022 05:31:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf6vEz63HPzR+JvEqNB6Wj+8v7xXqYXGeMGiC9t4T/OSmp7Pz33GJpSRE65wtDy54xlsvRXY X-Received: by 2002:a17:906:945a:b0:7a8:3597:34a8 with SMTP id z26-20020a170906945a00b007a8359734a8mr35191826ejx.628.1669815119338; Wed, 30 Nov 2022 05:31:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669815119; cv=none; d=google.com; s=arc-20160816; b=bnQPyqJazLDOQKKCLIYyrv3p1Vb+6n1ioLvQ0lo4/ISbR/PYhFtddA/aijDMUukPCQ BAzTK5/2grCYnU8bAPTvDy2LA8e5SGpFeV6HZE2XmgDcz4R35JUs9ZOBE3tO3O53X2hz wJD6s7rL2IsLOK5ehNu+xFXXBFQYDNJ4ZJuD/VtJ7vNx8wSE3d+KoNF3E+vtxrtwTAh/ KvsFc6VUecch0pSy7rPASAfx4vIGz9zzBMHtcLPVL+JRb04Y+G/pRTik2Ly6xBSRwBrQ /SyR224Mkb+SJ7k+Z16ybN6qWRAeAHhFEQ2LxKMLfJ1BlUksjBcZ1oqAK9VX0+J6yI7Q cuzw== 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=JZ02pBcNw3ivTfDwGgBkNytotimScpxpEc793DzsV5c=; b=aIiVzEzm8mdzekJ+J/LfrgxF6bCosqL4QWLTBu+oREBE+zjLm29eSUUbcT0xv3MGh9 sono2Vxz8uQwnzvV8XcRZZw5DHxW33xdmTCxXu2dO0qFAlWir6H1iFVUxy9LzgMVgWnu bDf0kHnsvs3MjY+owHTXduAYDYnYK151YFV4vC2vZOtmWqx+h5Z2jEqc7qnYe62cgP/j ERZNUgAZebY11qKN5RlWNsVN97kskAfZHF4z9J+F8d8fml0xliDfmeOlKbzuVY8AhK33 0pbSXgsHiwR+JHwytVTHQUa4/VG9MYF0+JST24PTFMgxzRHIuZpKF+83VGhHRPsfaXmu XJxg== 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 a20-20020a056402169400b004615bea1d62si1144077edv.472.2022.11.30.05.31.39; Wed, 30 Nov 2022 05:31:59 -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 S235505AbiK3NBM (ORCPT + 84 others); Wed, 30 Nov 2022 08:01:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233835AbiK3NA4 (ORCPT ); Wed, 30 Nov 2022 08:00:56 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C62FD4EC19; Wed, 30 Nov 2022 05:00:55 -0800 (PST) Received: from dggpeml500020.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NMfSW1hWRzHwK2; Wed, 30 Nov 2022 21:00:11 +0800 (CST) Received: from dggpeml500003.china.huawei.com (7.185.36.200) by dggpeml500020.china.huawei.com (7.185.36.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 30 Nov 2022 21:00:53 +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; Wed, 30 Nov 2022 21:00:53 +0800 From: Li Nan To: , , CC: , , , , , Subject: [PATCH -next v2 6/9] blk-iocost: change div64_u64 to DIV64_U64_ROUND_UP in ioc_refresh_params() Date: Wed, 30 Nov 2022 21:21:53 +0800 Message-ID: <20221130132156.2836184-7-linan122@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221130132156.2836184-1-linan122@huawei.com> References: <20221130132156.2836184-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: dggems706-chm.china.huawei.com (10.3.19.183) 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 f4a754b9d10f..2316ba93e7d6 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