diff options
author | Ming Lei <ming.lei@canoical.com> | 2014-09-17 05:47:58 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-09-22 14:00:07 -0400 |
commit | 2edd2c740b2918eb0a9a1fe1b69678b903769ec2 (patch) | |
tree | 36df228ed4b404fdf1b53b966ccc914ad5555df3 /block | |
parent | 0152fb6b57c4fae769ee75ea2ae670f4ff39fba9 (diff) |
blk-mq: remove unnecessary blk_clear_rq_complete()
This patch removes two unnecessary blk_clear_rq_complete(),
the REQ_ATOM_COMPLETE flag is cleared inside blk_mq_start_request(),
so:
- The blk_clear_rq_complete() in blk_flush_restore_request()
needn't because the request will be freed later, and clearing
it here may open a small race window with timeout.
- The blk_clear_rq_complete() in blk_mq_requeue_request() isn't
necessary too, even though REQ_ATOM_STARTED is cleared in
__blk_mq_requeue_request(), in theory it still may cause a small
race window with timeout since the two clear_bit() may be
reordered.
Signed-off-by: Ming Lei <ming.lei@canoical.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-flush.c | 2 | ||||
-rw-r--r-- | block/blk-mq.c | 1 |
2 files changed, 0 insertions, 3 deletions
diff --git a/block/blk-flush.c b/block/blk-flush.c index 698e6926388c..c8e25768f2e1 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c | |||
@@ -126,8 +126,6 @@ static void blk_flush_restore_request(struct request *rq) | |||
126 | /* make @rq a normal request */ | 126 | /* make @rq a normal request */ |
127 | rq->cmd_flags &= ~REQ_FLUSH_SEQ; | 127 | rq->cmd_flags &= ~REQ_FLUSH_SEQ; |
128 | rq->end_io = rq->flush.saved_end_io; | 128 | rq->end_io = rq->flush.saved_end_io; |
129 | |||
130 | blk_clear_rq_complete(rq); | ||
131 | } | 129 | } |
132 | 130 | ||
133 | static bool blk_flush_queue_rq(struct request *rq, bool add_front) | 131 | static bool blk_flush_queue_rq(struct request *rq, bool add_front) |
diff --git a/block/blk-mq.c b/block/blk-mq.c index d12f1983d493..3b277b4eaa95 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -439,7 +439,6 @@ static void __blk_mq_requeue_request(struct request *rq) | |||
439 | void blk_mq_requeue_request(struct request *rq) | 439 | void blk_mq_requeue_request(struct request *rq) |
440 | { | 440 | { |
441 | __blk_mq_requeue_request(rq); | 441 | __blk_mq_requeue_request(rq); |
442 | blk_clear_rq_complete(rq); | ||
443 | 442 | ||
444 | BUG_ON(blk_queued_rq(rq)); | 443 | BUG_ON(blk_queued_rq(rq)); |
445 | blk_mq_add_to_requeue_list(rq, true); | 444 | blk_mq_add_to_requeue_list(rq, true); |