From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C859FC4332F for ; Fri, 25 Nov 2022 10:14:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229772AbiKYKOt (ORCPT ); Fri, 25 Nov 2022 05:14:49 -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> Precedence: bulk List-ID: X-Mailing-List: linux-block@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)