Skip to content

Commit 4cddeac

Browse files
htejunaxboe
authored andcommitted
Revert "block: inherit request start time from bio for BLK_CGROUP"
This reverts commit 0006707. It has a couple problems: * bio_issue_time() is stored in bio->bi_issue truncated to 51 bits. This overflows in slightly over 26 days. Setting rq->io_start_time_ns with it means that io duration calculation would yield >26days after 26 days of uptime. This, for example, confuses kyber making it cause high IO latencies. * rq->io_start_time_ns should record the time that the IO is issued to the device so that on-device latency can be measured. However, bio_issue_time() is set before the bio goes through the rq-qos controllers (wbt, iolatency, iocost), so when the bio gets throttled in any of the mechanisms, the measured latencies make no sense - on-device latencies end up higher than request-alloc-to-completion latencies. We'll need a smarter way to avoid calling ktime_get_ns() repeatedly back-to-back. For now, let's revert the commit. Signed-off-by: Tejun Heo <[email protected]> Cc: [email protected] # v5.16+ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 8c936f9 commit 4cddeac

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

block/blk-mq.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,14 +1131,7 @@ void blk_mq_start_request(struct request *rq)
11311131
trace_block_rq_issue(rq);
11321132

11331133
if (test_bit(QUEUE_FLAG_STATS, &q->queue_flags)) {
1134-
u64 start_time;
1135-
#ifdef CONFIG_BLK_CGROUP
1136-
if (rq->bio)
1137-
start_time = bio_issue_time(&rq->bio->bi_issue);
1138-
else
1139-
#endif
1140-
start_time = ktime_get_ns();
1141-
rq->io_start_time_ns = start_time;
1134+
rq->io_start_time_ns = ktime_get_ns();
11421135
rq->stats_sectors = blk_rq_sectors(rq);
11431136
rq->rq_flags |= RQF_STATS;
11441137
rq_qos_issue(q, rq);

0 commit comments

Comments
 (0)