From patchwork Wed Nov 30 13:21:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Nan X-Patchwork-Id: 27783 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp909152wrr; Wed, 30 Nov 2022 05:02:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf4lxAwvsKlNRvGAB/l4Bm0WCQjUFloOxJmD42KzGoTruXZf0OX1raZaIUxAbEk3oT1zllnw X-Received: by 2002:a62:a515:0:b0:56e:28b1:56a3 with SMTP id v21-20020a62a515000000b0056e28b156a3mr42211121pfm.43.1669813320466; Wed, 30 Nov 2022 05:02:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669813320; cv=none; d=google.com; s=arc-20160816; b=x0tIBOz4oYm/ieqAEJ5mMyJlEpPFPtIXK8k/VB7QyFrYZ9Av8/YsQ4BNbJPCiCwXDF Lf5K+f3H/heXrNcbVZBApC5VPgoFSNuiNYVQKgfvaObbjBvJ3OlzjORRY12x3xSs0cNQ BD04rKBTcxHujKzGBmxaMcRuENYF5zC31r5kSN64mO3KbIpD7pHT5IkGurq9vsWlkfCf 88GevwaMgO7l0xRNUjC5sjqT9siNTHWppg8kMVXazjYqfEZ2yVp7pbFAUpZ5rNhZ6M0H yUQah3nmzhE8z7gTTKolVdJ4rc9nj5axPLSx54BIrnDHCCKMa72jNYS3dIBHF06rTD7d +XgA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r16-20020a63fc50000000b00477a32da0a9si1253479pgk.455.2022.11.30.05.01.45; Wed, 30 Nov 2022 05:02:00 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750926172051001168?= X-GMAIL-MSGID: =?utf-8?q?1750926172051001168?= 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 Acked-by: Tejun Heo --- 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;