diff options
author | Ming Lei <tom.leiming@gmail.com> | 2014-06-10 00:16:41 +0800 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-06-09 10:20:06 -0600 |
commit | 2b8393b43ec672bb263009cd74c056ab01d6ac17 (patch) | |
tree | 0cfe6b32335a14310ffec05da4e227b9ffea15ca /block | |
parent | 3ee3237239583a6555db4f297d00eebdbb6d76ad (diff) | |
download | linux-stable-2b8393b43ec672bb263009cd74c056ab01d6ac17.tar.gz linux-stable-2b8393b43ec672bb263009cd74c056ab01d6ac17.tar.bz2 linux-stable-2b8393b43ec672bb263009cd74c056ab01d6ac17.zip |
blk-mq: add timer in blk_mq_start_request
This way will become consistent with non-mq case, also
avoid to update rq->deadline twice for mq.
The comment said: "We do this early, to ensure we are on
the right CPU.", but no percpu stuff is used in blk_add_timer(),
so it isn't necessary. Even when inserting from plug list, there
is no such guarantee at all.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-mq.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index a5ea37d7e820..e11f5f8e0313 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -411,16 +411,7 @@ static void blk_mq_start_request(struct request *rq, bool last) if (unlikely(blk_bidi_rq(rq))) rq->next_rq->resid_len = blk_rq_bytes(rq->next_rq); - /* - * Just mark start time and set the started bit. Due to memory - * ordering, we know we'll see the correct deadline as long as - * REQ_ATOMIC_STARTED is seen. Use the default queue timeout, - * unless one has been set in the request. - */ - if (!rq->timeout) - rq->deadline = jiffies + q->rq_timeout; - else - rq->deadline = jiffies + rq->timeout; + blk_add_timer(rq); /* * Mark us as started and clear complete. Complete might have been @@ -972,11 +963,6 @@ static void __blk_mq_insert_request(struct blk_mq_hw_ctx *hctx, list_add_tail(&rq->queuelist, &ctx->rq_list); blk_mq_hctx_mark_pending(hctx, ctx); - - /* - * We do this early, to ensure we are on the right CPU. - */ - blk_add_timer(rq); } void blk_mq_insert_request(struct request *rq, bool at_head, bool run_queue, @@ -1219,7 +1205,6 @@ static void blk_mq_make_request(struct request_queue *q, struct bio *bio) blk_mq_bio_to_request(rq, bio); blk_mq_start_request(rq, true); - blk_add_timer(rq); /* * For OK queue, we are done. For error, kill it. Any other |