提交 df2806d0 编写于 作者: L Li Ruilin 提交者: Cheng Jian

bcache: always record start time of a sample

euleros/rtos inclusion
category: bugfix
bugzilla: https://bugzilla.openeuler.org/show_bug.cgi?id=26
CVE: NA

--------------------------------

Before this patch bypassed I/O request will not record start time,
therefore when calculating latency data, start time will be calculated
wrongly. This patch makes start time always be recorded to fix this.
Signed-off-by: NLi Ruilin <liruilin4@huawei.com>
Reviewed-by: NSong Chao <chao.song@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 d59d5f5c
...@@ -1299,14 +1299,13 @@ static blk_qc_t cached_dev_make_request(struct request_queue *q, ...@@ -1299,14 +1299,13 @@ static blk_qc_t cached_dev_make_request(struct request_queue *q,
atomic_inc(&dc->front_io_num); atomic_inc(&dc->front_io_num);
s->iop.bypass = check_should_bypass(dc, bio); s->iop.bypass = check_should_bypass(dc, bio);
if (!s->iop.bypass && bio->bi_iter.bi_size && !rw) {
s->smp.offset = bio->bi_iter.bi_sector - dc->sb.data_offset; s->smp.offset = bio->bi_iter.bi_sector - dc->sb.data_offset;
s->smp.length = bio->bi_iter.bi_size; s->smp.length = bio->bi_iter.bi_size;
s->smp.type = rw; s->smp.type = rw;
s->smp.dev = dc->bdev->bd_dev; s->smp.dev = dc->bdev->bd_dev;
s->smp.start_time = ktime_get_ns(); s->smp.start_time = ktime_get_ns();
if (!s->iop.bypass && bio->bi_iter.bi_size && !rw)
save_circ_item(&s->smp); save_circ_item(&s->smp);
}
if (rw) { if (rw) {
if ((s->iop.bypass == false) && if ((s->iop.bypass == false) &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册