Message ID | 20221018121932.10792-3-shikemeng@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1930084wrs; Tue, 18 Oct 2022 05:23:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7crKAonBq88L6GO3/ybzv5RloSi6tf+Bok88UbveZgX0LlVebX9BVf5fck2WFNgffQ9vt6 X-Received: by 2002:a17:907:7632:b0:78d:b5ba:87db with SMTP id jy18-20020a170907763200b0078db5ba87dbmr2159923ejc.661.1666095805849; Tue, 18 Oct 2022 05:23:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666095805; cv=none; d=google.com; s=arc-20160816; b=ufGA8QI411UXfQhS0/vg48oMoaCjmNbQwthDlzAF2CcpJ5Qf84lQCedvgypmIKc3Z/ LIz/ajdUXohpf83fcd5toB/fS0N8k74FF6pXKeOHnC4ygRTdLn6voGJvfd3vS5GfT8bU 7GfNjPsJkycu7iLzTLj52NptHAeLO445VB/+K6yt/EUxmiO9MZIzFz/VUlgZfsv5/bET 7U4YLebIJ0r7JTp3fTqCXGsBhQlJucuy8SpSWrzABJ+yyn5TeO7D8ijUzX8BV3opILkV DV6PkbhWW1R1YWsJBn2gncI7mdZc10vQOgEq1xkxzrVTDxI5/2cZr9AGytgMqBacmbMT vjvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=nOnSqj4i6hWGqcxuGP1U1QHsspOlohll2Voy5RQSWfI=; b=rPIvaOlqoBT0G5xqXvKqQqaq+F8Vcup+pepMq0sqcr+XC99XxFE1tW1LjO4omeUDWO EgvnxecbkwhhJDjKzTUR2qRZ1PzIIjY8kviifWOho1K+8OzVRGvX8/x9Cx/9L+IUkJJF Nsjsk3VJFD79WqYtsKmZrBxvb9VRuKB4gG8sWxjos94qmL6MnD+nA87eJywTwc41I2Et 5jVZAQGTc2YqYiIx7bUSY/cZTrrFV7PY/npWai9m4l7maEizET/qINy1x19RG3n2TmDD +oMfZ0owGDZ64t1w8OoV8pQ9r19r8EX5NdWBsexqd8S3zDP+N2Os9zMiSc84mVhWo7h2 by6w== 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 s21-20020a056402015500b00458a650f3fasi10217628edu.409.2022.10.18.05.22.57; Tue, 18 Oct 2022 05:23:25 -0700 (PDT) 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 S229773AbiJRMTt (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Tue, 18 Oct 2022 08:19:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229942AbiJRMTn (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 18 Oct 2022 08:19:43 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4F242E6; Tue, 18 Oct 2022 05:19:38 -0700 (PDT) Received: from kwepemi500016.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MsCbQ0hRbzHtx3; Tue, 18 Oct 2022 20:19:30 +0800 (CST) Received: from huawei.com (10.174.178.129) by kwepemi500016.china.huawei.com (7.221.188.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 18 Oct 2022 20:19:35 +0800 From: Kemeng Shi <shikemeng@huawei.com> To: <tj@kernel.org>, <josef@toxicpanda.com>, <axboe@kernel.dk> CC: <cgroups@vger.kernel.org>, <linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <shikemeng@huawei.com> Subject: [PATCH v2 2/5] blk-iocost: Reset vtime_base_rate in ioc_refresh_params Date: Tue, 18 Oct 2022 20:19:29 +0800 Message-ID: <20221018121932.10792-3-shikemeng@huawei.com> X-Mailer: git-send-email 2.14.1.windows.1 In-Reply-To: <20221018121932.10792-1-shikemeng@huawei.com> References: <20221018121932.10792-1-shikemeng@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.178.129] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500016.china.huawei.com (7.221.188.220) 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747028075799939131?= X-GMAIL-MSGID: =?utf-8?q?1747028075799939131?= |
Series |
A few cleanup and bugfix patches for blk-iocost
|
|
Commit Message
Kemeng Shi
Oct. 18, 2022, 12:19 p.m. UTC
Since commit ac33e91e2daca("blk-iocost: implement vtime loss compensation") split vtime_rate into vtime_rate and vtime_base_rate, we need reset both vtime_base_rate and vtime_rate when device parameters are refreshed. If vtime_base_rate is no reset here, vtime_rate will be overwritten with old vtime_base_rate soon in ioc_refresh_vrate. Signed-off-by: Kemeng Shi <shikemeng@huawei.com> Acked-by: Tejun Heo <tj@kernel.org> --- block/blk-iocost.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/block/blk-iocost.c b/block/blk-iocost.c index be4bc38821e2..9214733bbc14 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -906,8 +906,10 @@ static bool ioc_refresh_params(struct ioc *ioc, bool force) if (idx == ioc->autop_idx && !force) return false; - if (idx != ioc->autop_idx) + if (idx != ioc->autop_idx) { atomic64_set(&ioc->vtime_rate, VTIME_PER_USEC); + ioc->vtime_base_rate = VTIME_PER_USEC; + } ioc->autop_idx = idx; ioc->autop_too_fast_at = 0;