summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorMing Lei2014-01-03 18:00:08 +0100
committerJens Axboe2014-01-03 18:00:08 +0100
commit0fec08b4ecfc36fd8a64432343b2964fb86d2675 (patch)
tree4037e52bedcd991c89f789a99d8723638aed80e6 /block
parentblock: blk-mq: don't export blk_mq_free_queue() (diff)
downloadkernel-qcow2-linux-0fec08b4ecfc36fd8a64432343b2964fb86d2675.tar.gz
kernel-qcow2-linux-0fec08b4ecfc36fd8a64432343b2964fb86d2675.tar.xz
kernel-qcow2-linux-0fec08b4ecfc36fd8a64432343b2964fb86d2675.zip
blk-mq: fix initializing request's start time
blk_rq_init() is called in req's complete handler to initialize the request, so the members of start_time and start_time_ns might become inaccurate when it is allocated in future. The patch initializes the two members in blk_mq_rq_ctx_init() to fix the problem. Signed-off-by: Ming Lei <tom.leiming@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 6914f9bd470a..473ce4039060 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -190,6 +190,8 @@ static void blk_mq_rq_ctx_init(struct request_queue *q, struct blk_mq_ctx *ctx,
rq->mq_ctx = ctx;
rq->cmd_flags = rw_flags;
+ rq->start_time = jiffies;
+ set_start_time_ns(rq);
ctx->rq_dispatched[rw_is_sync(rw_flags)]++;
}