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 [thread overview]
Message-ID: <20221018121932.10792-3-shikemeng@huawei.com> (raw)
In-Reply-To: <20221018121932.10792-1-shikemeng@huawei.com>
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;
--
2.30.0
next prev parent reply other threads:[~2022-10-18 12:19 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 ` Kemeng Shi [this message]
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 ` [PATCH v2 4/5] blk-iocost: Remove vrate member in struct ioc_now Kemeng Shi
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-3-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®