Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5913055rwi; Tue, 18 Oct 2022 06:00:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4RUKmqq/ivRP1kXFgWeNJUeyJYDW6uS6UyCRyliRnCJSF9IKeF6LRrFVuRxvZikj5vUQrB X-Received: by 2002:a17:902:b589:b0:179:f8c5:7212 with SMTP id a9-20020a170902b58900b00179f8c57212mr2943969pls.174.1666098017834; Tue, 18 Oct 2022 06:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666098017; cv=none; d=google.com; s=arc-20160816; b=Q/p+pQ5RtMXIbQ3n8IjAQuZ37AbGCIFvQR48451y0UnuDRIF2CU4Ckmg/N+rzYVZdR n087KhfESmRhCdjBwJw07BwbEbJasb7ls+gr9ZfR53wj2hl+WLY/x43+pemoWYSaxlaT gUEabas3MaeGcIwdmpZUtRIkewOUJngGaygwKGKPmUmFVJl/aS5UsoklySEAJMTCz2tf qt6aNHYHbp0UqOnBBRXAdJn/5HO+a92uowqyh4RC5YP38BPaKSOLsh+JfxHRqWCjwGlx z37OvNIDL5WdEjufOGtztozf1oOKW1fTSvP9uz41fJGdVbIqDpAsNzWaonqbEK8x7v7a ikzg== 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=y82gj6jFxwSOLT4evzGCtMtiCxWOCmmM05nq/FBHXDg=; b=z+Nr15leX4dG+K6M+djj3wpI4fQFtDYhOweqKGPVEcoeS7Yo1j5bUoDledXicm5Ykf OqSoVBe3MfZuL++Vgcfddzubppg5zlBmq78zvbu7ZoUk8liCy9YbjlzOXMCXwV9a1Uqb zAioyyBtJzHh5lakib89RjMfO1BeuETlfb/icCT8RHmqpuBypc0xtwQvKMUy7NFmdGL6 9PUho0IpBuo/Dtrs/RULPCkS2QAkjPI14JuqjpDx7c59IeLVaJqegiljLexVO6z6INDk iajVrKlIFaK43xsgPRvJQ6c6mHP55EvEnH2ynn3So51a+DyPi876a66jq7WWk8C2K3J1 qEdQ== 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 w4-20020a656944000000b0044b5e15db73si15151292pgq.249.2022.10.18.05.59.59; Tue, 18 Oct 2022 06:00:16 -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 S230062AbiJRMT7 (ORCPT + 99 others); Tue, 18 Oct 2022 08:19:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229964AbiJRMTn (ORCPT ); Tue, 18 Oct 2022 08:19:43 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5DDC13E3B; Tue, 18 Oct 2022 05:19:39 -0700 (PDT) Received: from kwepemi500016.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MsCXW3M71zJn2y; Tue, 18 Oct 2022 20:16:59 +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:37 +0800 From: Kemeng Shi To: , , CC: , , , Subject: [PATCH v2 4/5] blk-iocost: Remove vrate member in struct ioc_now Date: Tue, 18 Oct 2022 20:19:31 +0800 Message-ID: <20221018121932.10792-5-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: X-Mailing-List: linux-kernel@vger.kernel.org If we trace vtime_base_rate instead of vtime_rate, there is nowhere which accesses now->vrate except function ioc_now using now->vrate locally. Just remove it. Signed-off-by: Kemeng Shi Acked-by: Tejun Heo --- block/blk-iocost.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/blk-iocost.c b/block/blk-iocost.c index b0991b52e3dd..761295ed9c5a 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -556,7 +556,6 @@ struct ioc_now { u64 now_ns; u64 now; u64 vnow; - u64 vrate; }; struct iocg_wait { @@ -1020,10 +1019,11 @@ static void ioc_adjust_base_vrate(struct ioc *ioc, u32 rq_wait_pct, static void ioc_now(struct ioc *ioc, struct ioc_now *now) { unsigned seq; + u64 vrate; now->now_ns = ktime_get(); now->now = ktime_to_us(now->now_ns); - now->vrate = atomic64_read(&ioc->vtime_rate); + vrate = atomic64_read(&ioc->vtime_rate); /* * The current vtime is @@ -1036,7 +1036,7 @@ static void ioc_now(struct ioc *ioc, struct ioc_now *now) do { seq = read_seqcount_begin(&ioc->period_seqcount); now->vnow = ioc->period_at_vtime + - (now->now - ioc->period_at) * now->vrate; + (now->now - ioc->period_at) * vrate; } while (read_seqcount_retry(&ioc->period_seqcount, seq)); } -- 2.30.0