* [PATCH] blk-mq: I/O and timer unplugs are inverted in blktrace
@ 2018-09-26 12:35 Ilya Dryomov
2018-09-27 19:09 ` Omar Sandoval
2018-09-27 19:12 ` Jens Axboe
0 siblings, 2 replies; 3+ messages in thread
From: Ilya Dryomov @ 2018-09-26 12:35 UTC (permalink / raw)
To: linux-block; +Cc: Jens Axboe, Bart Van Assche, Omar Sandoval
trace_block_unplug() takes true for explicit unplugs and false for
implicit unplugs. schedule() unplugs are implicit and should be
reported as timer unplugs. While correct in the legacy code, this has
been inverted in blk-mq since 4.11.
Cc: stable@vger.kernel.org
Fixes: bd166ef183c2 ("blk-mq-sched: add framework for MQ capable IO schedulers")
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
---
block/blk-mq.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 85a1c1a59c72..e3c39ea8e17b 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1628,7 +1628,7 @@ void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule)
BUG_ON(!rq->q);
if (rq->mq_ctx != this_ctx) {
if (this_ctx) {
- trace_block_unplug(this_q, depth, from_schedule);
+ trace_block_unplug(this_q, depth, !from_schedule);
blk_mq_sched_insert_requests(this_q, this_ctx,
&ctx_list,
from_schedule);
@@ -1648,7 +1648,7 @@ void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule)
* on 'ctx_list'. Do those.
*/
if (this_ctx) {
- trace_block_unplug(this_q, depth, from_schedule);
+ trace_block_unplug(this_q, depth, !from_schedule);
blk_mq_sched_insert_requests(this_q, this_ctx, &ctx_list,
from_schedule);
}
--
2.14.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] blk-mq: I/O and timer unplugs are inverted in blktrace
2018-09-26 12:35 [PATCH] blk-mq: I/O and timer unplugs are inverted in blktrace Ilya Dryomov
@ 2018-09-27 19:09 ` Omar Sandoval
2018-09-27 19:12 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Omar Sandoval @ 2018-09-27 19:09 UTC (permalink / raw)
To: Ilya Dryomov; +Cc: linux-block, Jens Axboe, Bart Van Assche, Omar Sandoval
On Wed, Sep 26, 2018 at 02:35:50PM +0200, Ilya Dryomov wrote:
> trace_block_unplug() takes true for explicit unplugs and false for
> implicit unplugs. schedule() unplugs are implicit and should be
> reported as timer unplugs. While correct in the legacy code, this has
> been inverted in blk-mq since 4.11.
>
> Cc: stable@vger.kernel.org
> Fixes: bd166ef183c2 ("blk-mq-sched: add framework for MQ capable IO schedulers")
Reviewed-by: Omar Sandoval <osandov@fb.com>
> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
> ---
> block/blk-mq.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 85a1c1a59c72..e3c39ea8e17b 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -1628,7 +1628,7 @@ void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule)
> BUG_ON(!rq->q);
> if (rq->mq_ctx != this_ctx) {
> if (this_ctx) {
> - trace_block_unplug(this_q, depth, from_schedule);
> + trace_block_unplug(this_q, depth, !from_schedule);
> blk_mq_sched_insert_requests(this_q, this_ctx,
> &ctx_list,
> from_schedule);
> @@ -1648,7 +1648,7 @@ void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule)
> * on 'ctx_list'. Do those.
> */
> if (this_ctx) {
> - trace_block_unplug(this_q, depth, from_schedule);
> + trace_block_unplug(this_q, depth, !from_schedule);
> blk_mq_sched_insert_requests(this_q, this_ctx, &ctx_list,
> from_schedule);
> }
> --
> 2.14.4
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] blk-mq: I/O and timer unplugs are inverted in blktrace
2018-09-26 12:35 [PATCH] blk-mq: I/O and timer unplugs are inverted in blktrace Ilya Dryomov
2018-09-27 19:09 ` Omar Sandoval
@ 2018-09-27 19:12 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2018-09-27 19:12 UTC (permalink / raw)
To: Ilya Dryomov, linux-block@vger.kernel.org; +Cc: Bart Van Assche, Omar Sandoval
T24gOS8yNi8xOCA2OjM1IEFNLCBJbHlhIERyeW9tb3Ygd3JvdGU6DQo+IHRyYWNlX2Jsb2NrX3Vu
cGx1ZygpIHRha2VzIHRydWUgZm9yIGV4cGxpY2l0IHVucGx1Z3MgYW5kIGZhbHNlIGZvcg0KPiBp
bXBsaWNpdCB1bnBsdWdzLiAgc2NoZWR1bGUoKSB1bnBsdWdzIGFyZSBpbXBsaWNpdCBhbmQgc2hv
dWxkIGJlDQo+IHJlcG9ydGVkIGFzIHRpbWVyIHVucGx1Z3MuICBXaGlsZSBjb3JyZWN0IGluIHRo
ZSBsZWdhY3kgY29kZSwgdGhpcyBoYXMNCj4gYmVlbiBpbnZlcnRlZCBpbiBibGstbXEgc2luY2Ug
NC4xMS4NCg0KVGhhdCdzIHByZXR0eSBzaWxseS4uLiBUaGFua3MsIHdpbGwgcXVldWUgdXAgZm9y
IDQuMTkuDQoNCi0tIA0KSmVucyBBeGJvZQ0KDQo=
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-09-28 1:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-26 12:35 [PATCH] blk-mq: I/O and timer unplugs are inverted in blktrace Ilya Dryomov
2018-09-27 19:09 ` Omar Sandoval
2018-09-27 19:12 ` Jens Axboe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.