From: Kemeng Shi <shikemeng@huawei.com>
To: <tj@kernel.org>, <axboe@kernel.dk>, <linux-block@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: <shikemeng@huawei.com>
Subject: [PATCH 3/8] blk-iocost: Trace vtime_base_rate instead of vtime_rate
Date: Mon, 17 Oct 2022 10:00:06 +0800 [thread overview]
Message-ID: <20221017020011.25016-4-shikemeng@huawei.com> (raw)
In-Reply-To: <20221017020011.25016-1-shikemeng@huawei.com>
Since commit ac33e91e2daca ("blk-iocost: implement vtime loss
compensation") rename original vtime_base to vtime_base_rate
and current vtime_base is original vtime_base with compensation.
The current rate showed in tracepoint is mixed with vtime_base
and vtime_base_rate:
1) In function ioc_adjust_base_vrate, the first trace_iocost_ioc_vrate_adj
shows vtime_base, the second trace_iocost_ioc_vrate_adj shows
vtime_base_rate.
2) In function iocg_activate shows vtime_base by calling
TRACE_IOCG_PATH(iocg_activate...
3) In function ioc_check_iocgs shows vtime_base by calling
TRACE_IOCG_PATH(iocg_idle...
Trace vtime_base_rate instead of vtime_rate as:
1) Before commit ac33e91e2daca ("blk-iocost: implement vtime loss
compensation"), the traced rate is without compensation, so still
show rate without compensation.
2) The vtime_base_rate is more stable while vtime_rate heavily depends on
excess budeget on current period which may change abruptly in next period.
Signed-off-by: Kemeng Shi <shikemeng@huawei.com>
---
block/blk-iocost.c | 2 +-
include/trace/events/iocost.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index 9214733bbc14..b0991b52e3dd 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -977,7 +977,7 @@ static void ioc_adjust_base_vrate(struct ioc *ioc, u32 rq_wait_pct,
if (!ioc->busy_level || (ioc->busy_level < 0 && nr_lagging)) {
if (ioc->busy_level != prev_busy_level || nr_lagging)
- trace_iocost_ioc_vrate_adj(ioc, atomic64_read(&ioc->vtime_rate),
+ trace_iocost_ioc_vrate_adj(ioc, vrate,
missed_ppm, rq_wait_pct,
nr_lagging, nr_shortages);
diff --git a/include/trace/events/iocost.h b/include/trace/events/iocost.h
index 6d1626e7a4ce..af8bfed528fc 100644
--- a/include/trace/events/iocost.h
+++ b/include/trace/events/iocost.h
@@ -38,7 +38,7 @@ DECLARE_EVENT_CLASS(iocost_iocg_state,
__assign_str(cgroup, path);
__entry->now = now->now;
__entry->vnow = now->vnow;
- __entry->vrate = now->vrate;
+ __entry->vrate = iocg->ioc->vtime_base_rate;
__entry->last_period = last_period;
__entry->cur_period = cur_period;
__entry->vtime = vtime;
@@ -160,7 +160,7 @@ TRACE_EVENT(iocost_ioc_vrate_adj,
TP_fast_assign(
__assign_str(devname, ioc_name(ioc));
- __entry->old_vrate = atomic64_read(&ioc->vtime_rate);
+ __entry->old_vrate = ioc->vtime_base_rate;
__entry->new_vrate = new_vrate;
__entry->busy_level = ioc->busy_level;
__entry->read_missed_ppm = missed_ppm[READ];
--
2.30.0
next prev parent reply other threads:[~2022-10-17 2:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-17 2:00 [PATCH 0/8] A few cleanup and bugfix patches for blk-iocost Kemeng Shi
2022-10-17 2:00 ` [PATCH 1/8] blk-iocost: Fix typo in comment Kemeng Shi
2022-10-17 18:52 ` Tejun Heo
2022-10-17 2:00 ` [PATCH 2/8] blk-iocost: Reset vtime_base_rate in ioc_refresh_params Kemeng Shi
2022-10-17 18:59 ` Tejun Heo
2022-10-17 2:00 ` Kemeng Shi [this message]
2022-10-17 19:03 ` [PATCH 3/8] blk-iocost: Trace vtime_base_rate instead of vtime_rate Tejun Heo
2022-10-17 2:00 ` [PATCH 4/8] blk-iocost: Remove vrate member in struct ioc_now Kemeng Shi
2022-10-17 19:08 ` Tejun Heo
2022-10-17 2:00 ` [PATCH 5/8] blk-iocost: Correct comment in blk_iocost_init Kemeng Shi
2022-10-17 19:10 ` Tejun Heo
2022-10-17 2:00 ` [PATCH 6/8] blk-iocost: Avoid to call current_hweight_max if iocg->inuse == iocg->active Kemeng Shi
2022-10-17 19:15 ` Tejun Heo
2022-10-17 2:00 ` [PATCH 7/8] blk-iocost: Remove redundant initialization of struct ioc_gq Kemeng Shi
2022-10-17 19:16 ` Tejun Heo
2022-10-17 2:00 ` [PATCH 8/8] blk-iocost: Get ioc_now inside weight_updated Kemeng Shi
2022-10-17 19:19 ` Tejun Heo
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=20221017020011.25016-4-shikemeng@huawei.com \
--to=shikemeng@huawei.com \
--cc=axboe@kernel.dk \
--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®