Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8950542rwb; Thu, 24 Nov 2022 06:18:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf5j7t30EEjqFk5Iu3B4Qek5UPTmbcqoLzPR21OEI1r+LDkexN7Hr1NBKf24S0Qwux+QtSJr X-Received: by 2002:a62:ee05:0:b0:56b:b253:36da with SMTP id e5-20020a62ee05000000b0056bb25336damr20304043pfi.59.1669299531938; Thu, 24 Nov 2022 06:18:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669299531; cv=none; d=google.com; s=arc-20160816; b=e8S/Zwxpx4MFeqdKPsnL8+ClwzUNx2ddrsz9nkrf1OUh/ZjNObvDepoOnuQGa0UTAa FjHwVNtHOgl1wDygFyLyIh3YqUgd3tLeRgZJ7RHyjRlnCEY6uMw+kII4UcFCgGZfFRdJ raQHFkv9HJwgwPXPLZ8/vVCtdcuX2DCasvGJ9QmO1/XA0HMNuLC625V9/WFIzA2zS8+D yNAr6V7m7nSVjAnpYe9PsdjcgG34fnl8VEJv8+tZAqIMKRzei34aVcnXb08fiSqzpAdW N+lG91KKHJjyT7wd685bdM/3w0wDyieazZSvuzoLQFw5sBLQk5803r1iMz0XdpKUWb7O 6Bqw== 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=fq4+YxkUWvUNlwBLLYUT5eTQnxEQzCL4L3q4Wm8f7dI=; b=jEu1nxRfNRnw/mqXVc0LtJsdZyiyiyyhnoML80mcsI0iahPL0iT/TSeUc9+wk6QRie tGuyrFa467wHk6/8NkP61YUgfxVn8/rR3DLKgRCUmtP7ZLyfDwrapbOpiv0ya7RaJVDl 1Bb5CEAUO34Dio2rpPgf0bc2MAnNNDLpg+W9k8f/mbOLJuJXGMoV+dQjTnOTqN+msFLR KEpRcSfaun2/jTiLWDAdGOFja5hoHJ0GLYmBmaxF2uB0D9nEVZXwno1gPq0oPIaIQiOi uxrAHWQ+dfHbylFuV86uherk711/9cUD/J2ZETo+7wth2btECcy6t7tHyiebjT1FQmmw qIow== 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 mn4-20020a17090b188400b0021824fcc6b9si1351663pjb.63.2022.11.24.06.18.40; Thu, 24 Nov 2022 06:18:51 -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 S230040AbiKXNpi (ORCPT + 86 others); Thu, 24 Nov 2022 08:45:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230094AbiKXNp3 (ORCPT ); Thu, 24 Nov 2022 08:45:29 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE29A1095A0; Thu, 24 Nov 2022 05:45:23 -0800 (PST) Received: from dggpeml500020.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NHzkh4cHKzHw1P; Thu, 24 Nov 2022 21:44:44 +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; Thu, 24 Nov 2022 21:45:22 +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; Thu, 24 Nov 2022 21:45:21 +0800 From: Li Nan To: , , CC: , , , , , Subject: [PATCH -next 2/2] blk-iocost: change div64_u64 to DIV64_U64_ROUND_UP in ioc_refresh_params() Date: Thu, 24 Nov 2022 22:06:35 +0800 Message-ID: <20221124140635.695205-2-linan122@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221124140635.695205-1-linan122@huawei.com> References: <20221124140635.695205-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 a38a5324bf10..9030ad8672f3 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