Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp10304438rwb; Fri, 25 Nov 2022 03:25:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf7LdfI2oDK+q0lVgsZ54iq8sWuaE4SKQKdf81gBToKCi93mYcTOCWqa+0pwADnuHDHiaSgn X-Received: by 2002:a17:906:144c:b0:7ad:cda3:93c7 with SMTP id q12-20020a170906144c00b007adcda393c7mr31909875ejc.500.1669375533900; Fri, 25 Nov 2022 03:25:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669375533; cv=none; d=google.com; s=arc-20160816; b=zEJHn6GfwKiYiXnLOR1bgMp9shNcAgea/MVN/dVKWfWPqOblAmEIbaLT5nwF8Ln37Q kCjJBy22Q5OvYaT21BRqtflTa/7Gjd2ZSen7MUIpi1JnJ3EdhzL7Snq1Vi8MltA1ep5s sEKKuX5H0hP/CCKyhrIDQmDghWMqPgmGvWa4eHXHW+GL3oMiictIQMh+CMPY1KorgGNE nUCTac7dBFv8dY0opjlapYCeSeiYCzqPyoMcVB/pkNv5NeMs3a+hivZuW09Q/lfoKEtN C3gdxHVPivNQ8Yb9/xaHdl5bcWeEC/82CkyC/vl88OQQNKrFsIZjzUVuPaWgXTUcr+WN Mp+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=Ktt+/ZYL1xCbjfcRNgvv+Mm6BA/t+FfR0Lzt53hhHtI=; b=sOr7GXTfAEo8nRx+WCS+zDmELAkFHgK0KH/yXhfSzTdmYUlMtP6jMZ32XBneIPlAbI wUiO0xx6umFF3TUXrpNnyOWgX8sWtOnYF78VFHzdIF8cQAM4sOIQeRc0l3dRtRQQghFM z4Z+d7zlB9sGyvielUQsZrUCk+iELWoHDcaulIOOKxIV+jwUraTcjRcD+0qQTN8wB17m RpbjniIP5WVmjV9xQnWb4epBAhHHGLg2UMZSmb/Dj2hkwDnkzS1hWcz6wHucPZjBDeAg /t5ieQ/QkXS1ETYJO3nhLrE/yr0aeXhzJXIp/Hvx2izIYWaA6mPiBY9SZ6KoJs8zCgSn p1LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=V7cYwN6z; dkim=neutral (no key) header.i=@suse.de; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p25-20020a056402075900b0046a2ce37129si3064069edy.616.2022.11.25.03.25.13; Fri, 25 Nov 2022 03:25:33 -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; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=V7cYwN6z; dkim=neutral (no key) header.i=@suse.de; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229953AbiKYKOu (ORCPT + 86 others); Fri, 25 Nov 2022 05:14:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229595AbiKYKOt (ORCPT ); Fri, 25 Nov 2022 05:14:49 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84AED2FC22; Fri, 25 Nov 2022 02:14:48 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 430BE21871; Fri, 25 Nov 2022 10:14:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1669371287; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ktt+/ZYL1xCbjfcRNgvv+Mm6BA/t+FfR0Lzt53hhHtI=; b=V7cYwN6zMePIafDyR97fv+1c1jMsEAutNfgvBs1R4VydI4ZqGvdSEGOuyZAz+ygMnMeudm Ryya9oCtbEHv8GSGL2M4e1cvFe/uAP4V6lhRy96kdF12nFtUupqgFVuD2gzCa7rxM4hCrp HJQlOZ+c9fbEswdA7+6hYnpOQVjs58g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1669371287; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ktt+/ZYL1xCbjfcRNgvv+Mm6BA/t+FfR0Lzt53hhHtI=; b=3WF6NMPuqnXBsXUfc9heSPeKDZ+AIrd/O08jOtknxnXsCB5CsULsI4o7/4DTSq4IgbpBd8 8krhfSd5ttmdn9DQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A631613A08; Fri, 25 Nov 2022 10:14:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id QRCbIpaVgGMqYwAAMHmgww (envelope-from ); Fri, 25 Nov 2022 10:14:46 +0000 Date: Fri, 25 Nov 2022 11:14:44 +0100 From: Andreas Herrmann To: Li Nan Cc: tj@kernel.org, josef@toxicpanda.com, axboe@kernel.dk, cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yi.zhang@huawei.com Subject: Re: [PATCH -next 2/2] blk-iocost: change div64_u64 to DIV64_U64_ROUND_UP in ioc_refresh_params() Message-ID: References: <20221124140635.695205-1-linan122@huawei.com> <20221124140635.695205-2-linan122@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221124140635.695205-2-linan122@huawei.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 On Thu, Nov 24, 2022 at 10:06:35PM +0800, Li Nan wrote: > 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(-) Reviewed-by: Andreas Herrmann > 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 > -- Regards, Andreas SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nürnberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman (HRB 36809, AG Nürnberg)