]>
Commit | Line | Data |
---|---|---|
7c34048e GKH |
1 | From 587562d0c7cd6861f4f90a2eb811cccb1a376f5f Mon Sep 17 00:00:00 2001 |
2 | From: Ilya Dryomov <idryomov@gmail.com> | |
3 | Date: Wed, 26 Sep 2018 14:35:50 +0200 | |
4 | Subject: blk-mq: I/O and timer unplugs are inverted in blktrace | |
5 | ||
6 | From: Ilya Dryomov <idryomov@gmail.com> | |
7 | ||
8 | commit 587562d0c7cd6861f4f90a2eb811cccb1a376f5f upstream. | |
9 | ||
10 | trace_block_unplug() takes true for explicit unplugs and false for | |
11 | implicit unplugs. schedule() unplugs are implicit and should be | |
12 | reported as timer unplugs. While correct in the legacy code, this has | |
13 | been inverted in blk-mq since 4.11. | |
14 | ||
15 | Cc: stable@vger.kernel.org | |
16 | Fixes: bd166ef183c2 ("blk-mq-sched: add framework for MQ capable IO schedulers") | |
17 | Reviewed-by: Omar Sandoval <osandov@fb.com> | |
18 | Signed-off-by: Ilya Dryomov <idryomov@gmail.com> | |
19 | Signed-off-by: Jens Axboe <axboe@kernel.dk> | |
20 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
21 | ||
22 | --- | |
23 | block/blk-mq.c | 4 ++-- | |
24 | 1 file changed, 2 insertions(+), 2 deletions(-) | |
25 | ||
26 | --- a/block/blk-mq.c | |
27 | +++ b/block/blk-mq.c | |
28 | @@ -1596,7 +1596,7 @@ void blk_mq_flush_plug_list(struct blk_p | |
29 | BUG_ON(!rq->q); | |
30 | if (rq->mq_ctx != this_ctx) { | |
31 | if (this_ctx) { | |
32 | - trace_block_unplug(this_q, depth, from_schedule); | |
33 | + trace_block_unplug(this_q, depth, !from_schedule); | |
34 | blk_mq_sched_insert_requests(this_q, this_ctx, | |
35 | &ctx_list, | |
36 | from_schedule); | |
37 | @@ -1616,7 +1616,7 @@ void blk_mq_flush_plug_list(struct blk_p | |
38 | * on 'ctx_list'. Do those. | |
39 | */ | |
40 | if (this_ctx) { | |
41 | - trace_block_unplug(this_q, depth, from_schedule); | |
42 | + trace_block_unplug(this_q, depth, !from_schedule); | |
43 | blk_mq_sched_insert_requests(this_q, this_ctx, &ctx_list, | |
44 | from_schedule); | |
45 | } |