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 4/5] blk-iocost: Remove vrate member in struct ioc_now
Date: Tue, 18 Oct 2022 20:19:31 +0800 [thread overview]
Message-ID: <20221018121932.10792-5-shikemeng@huawei.com> (raw)
In-Reply-To: <20221018121932.10792-1-shikemeng@huawei.com>
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 <shikemeng@huawei.com>
Acked-by: Tejun Heo <tj@kernel.org>
---
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
next prev parent reply other threads:[~2022-10-18 12:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-18 12:19 [PATCH v2 0/5] A few cleanup and bugfix patches for blk-iocost Kemeng Shi
2022-10-18 12:19 ` [PATCH v2 1/5] blk-iocost: Fix typo in comment Kemeng Shi
2022-10-18 12:19 ` [PATCH v2 2/5] blk-iocost: Reset vtime_base_rate in ioc_refresh_params Kemeng Shi
2022-10-18 12:19 ` [PATCH v2 3/5] blk-iocost: Trace vtime_base_rate instead of vtime_rate Kemeng Shi
2022-10-18 12:19 ` Kemeng Shi [this message]
2022-10-18 12:19 ` [PATCH v2 5/5] blk-iocost: Correct comment in blk_iocost_init Kemeng Shi
2022-11-23 6:09 ` [PATCH v2 0/5] A few cleanup and bugfix patches for blk-iocost Kemeng Shi
2022-12-01 1:45 ` Kemeng Shi
2022-12-01 1:46 ` Jens Axboe
2022-12-01 2:20 ` Kemeng Shi
2022-12-01 2:28 ` Jens Axboe
2022-12-01 1:47 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221018121932.10792-5-shikemeng@huawei.com \
--to=shikemeng@huawei.com \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®