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.c | |
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.c')
-rw-r--r-- | block/blk-mq.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 7138cd98146e..e2ef7b460924 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -350,7 +350,7 @@ void __blk_mq_finish_request(struct blk_mq_hw_ctx *hctx, struct blk_mq_ctx *ctx, | |||
350 | if (rq->tag != -1) | 350 | if (rq->tag != -1) |
351 | blk_mq_put_tag(hctx, hctx->tags, ctx, rq->tag); | 351 | blk_mq_put_tag(hctx, hctx->tags, ctx, rq->tag); |
352 | if (sched_tag != -1) | 352 | if (sched_tag != -1) |
353 | blk_mq_sched_completed_request(hctx, rq); | 353 | blk_mq_put_tag(hctx, hctx->sched_tags, ctx, sched_tag); |
354 | blk_mq_sched_restart(hctx); | 354 | blk_mq_sched_restart(hctx); |
355 | blk_queue_exit(q); | 355 | blk_queue_exit(q); |
356 | } | 356 | } |
@@ -444,6 +444,9 @@ static void __blk_mq_complete_request(struct request *rq) | |||
444 | { | 444 | { |
445 | struct request_queue *q = rq->q; | 445 | struct request_queue *q = rq->q; |
446 | 446 | ||
447 | if (rq->internal_tag != -1) | ||
448 | blk_mq_sched_completed_request(rq); | ||
449 | |||
447 | blk_mq_stat_add(rq); | 450 | blk_mq_stat_add(rq); |
448 | 451 | ||
449 | if (!q->softirq_done_fn) | 452 | if (!q->softirq_done_fn) |