diff options
author | Omar Sandoval <osandov@fb.com> | 2017-04-14 04:00:01 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-04-14 16:06:57 -0400 |
commit | c05f8525f67b7d6489b0502211d4ed35622d9beb (patch) | |
tree | fe474e51721e497374bbf6e674f883e54138e699 /block/blk-mq-sched.h | |
parent | 5b72727299307e53888277729f980ab03264dac8 (diff) |
blk-mq-sched: make completed_request() callback more useful
Currently, this callback is called right after put_request() and has no
distinguishable purpose. Instead, let's call it before put_request() as
soon as I/O has completed on the request, before we account it in
blk-stat. With this, Kyber can enable stats when it sees a latency
outlier and make sure the outlier gets accounted.
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-mq-sched.h')
-rw-r--r-- | block/blk-mq-sched.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/block/blk-mq-sched.h b/block/blk-mq-sched.h index f4bc186c3440..120c6abc37cc 100644 --- a/block/blk-mq-sched.h +++ b/block/blk-mq-sched.h | |||
@@ -82,17 +82,12 @@ blk_mq_sched_allow_merge(struct request_queue *q, struct request *rq, | |||
82 | return true; | 82 | return true; |
83 | } | 83 | } |
84 | 84 | ||
85 | static inline void | 85 | static inline void blk_mq_sched_completed_request(struct request *rq) |
86 | blk_mq_sched_completed_request(struct blk_mq_hw_ctx *hctx, struct request *rq) | ||
87 | { | 86 | { |
88 | struct elevator_queue *e = hctx->queue->elevator; | 87 | struct elevator_queue *e = rq->q->elevator; |
89 | 88 | ||
90 | if (e && e->type->ops.mq.completed_request) | 89 | if (e && e->type->ops.mq.completed_request) |
91 | e->type->ops.mq.completed_request(hctx, rq); | 90 | e->type->ops.mq.completed_request(rq); |
92 | |||
93 | BUG_ON(rq->internal_tag == -1); | ||
94 | |||
95 | blk_mq_put_tag(hctx, hctx->sched_tags, rq->mq_ctx, rq->internal_tag); | ||
96 | } | 91 | } |
97 | 92 | ||
98 | static inline void blk_mq_sched_started_request(struct request *rq) | 93 | static inline void blk_mq_sched_started_request(struct request *rq) |