From: Li Ruilin liruilin4@huawei.com
euleros/rtos inclusion category: bugfix bugzilla: https://bugzilla.openeuler.org/show_bug.cgi?id=26 DTS: https://code.huawei.com/hulk/hulk/issues/682
--------------------------------
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: Li Ruilin liruilin4@huawei.com Reviewed-by: Song Chao chao.song@huawei.com --- drivers/md/bcache/request.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index d34fe2b69956..a7c64447ec66 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -1304,14 +1304,13 @@ static blk_qc_t cached_dev_make_request(struct request_queue *q, atomic_inc(&dc->front_io_num); 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.length = bio->bi_iter.bi_size; - s->smp.type = rw; - s->smp.dev = dc->bdev->bd_dev; - s->smp.start_time = ktime_get_ns(); + s->smp.offset = bio->bi_iter.bi_sector - dc->sb.data_offset; + s->smp.length = bio->bi_iter.bi_size; + s->smp.type = rw; + s->smp.dev = dc->bdev->bd_dev; + s->smp.start_time = ktime_get_ns(); + if (!s->iop.bypass && bio->bi_iter.bi_size && !rw) save_circ_item(&s->smp); - }
if (rw) { if ((s->iop.bypass == false) &&