From: Jens Axboe <axboe@kernel.dk>
To: Christoph Hellwig <hch@infradead.org>
Cc: Dave Chinner <david@fromorbit.com>, linux-kernel@vger.kernel.org
Subject: Re: [Regression x2, 3.13-git] virtio block mq hang, iostat busted on virtio devices
Date: Tue, 19 Nov 2013 09:05:09 -0700 [thread overview]
Message-ID: <20131119160509.GB21343@kernel.dk> (raw)
In-Reply-To: <20131119103635.GA9223@infradead.org>
On Tue, Nov 19 2013, Christoph Hellwig wrote:
> On Tue, Nov 19, 2013 at 07:02:18PM +1100, Dave Chinner wrote:
> > I have no idea if it's related to the above hang, but either way
> > breaking iostat is a major regression....
>
> Both of them are most likely due to the conversion of virtio_blk
> to the blk-mq code.
>
> I've not seen the hang in my heavy xfstests testing, but that was a
> slightly different codebase than what finally got in, so I'll try
> to reproduce it once I get some spare QA cycles.
Thanks! Dave, if you still have it in that state, can you dump the
contents of /sys/block/<devs>/mq/ for the device/devices that are hung?
> The missing stats should be solved by something like the patch below
> (untested so far):
>
>
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 862f458..41e3b85 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -175,7 +175,7 @@ static void blk_mq_rq_ctx_init(struct blk_mq_ctx *ctx, struct request *rq,
> unsigned int rw_flags)
> {
> rq->mq_ctx = ctx;
> - rq->cmd_flags = rw_flags;
> + rq->cmd_flags = rw_flags | REQ_IO_STAT;
> ctx->rq_dispatched[rw_is_sync(rw_flags)]++;
> }
I have queued up the below.
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 862f458..ef90f18 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -171,9 +171,12 @@ bool blk_mq_can_queue(struct blk_mq_hw_ctx *hctx)
}
EXPORT_SYMBOL(blk_mq_can_queue);
-static void blk_mq_rq_ctx_init(struct blk_mq_ctx *ctx, struct request *rq,
- unsigned int rw_flags)
+static void blk_mq_rq_ctx_init(struct request_queue *q, struct blk_mq_ctx *ctx,
+ struct request *rq, unsigned int rw_flags)
{
+ if (blk_queue_io_stat(q))
+ rw_flags |= REQ_IO_STAT;
+
rq->mq_ctx = ctx;
rq->cmd_flags = rw_flags;
ctx->rq_dispatched[rw_is_sync(rw_flags)]++;
@@ -197,7 +200,7 @@ static struct request *blk_mq_alloc_request_pinned(struct request_queue *q,
rq = __blk_mq_alloc_request(hctx, gfp & ~__GFP_WAIT, reserved);
if (rq) {
- blk_mq_rq_ctx_init(ctx, rq, rw);
+ blk_mq_rq_ctx_init(q, ctx, rq, rw);
break;
} else if (!(gfp & __GFP_WAIT))
break;
@@ -921,7 +924,7 @@ static void blk_mq_make_request(struct request_queue *q, struct bio *bio)
trace_block_getrq(q, bio, rw);
rq = __blk_mq_alloc_request(hctx, GFP_ATOMIC, false);
if (likely(rq))
- blk_mq_rq_ctx_init(ctx, rq, rw);
+ blk_mq_rq_ctx_init(q, ctx, rq, rw);
else {
blk_mq_put_ctx(ctx);
trace_block_sleeprq(q, bio, rw);
--
Jens Axboe
next prev parent reply other threads:[~2013-11-19 16:05 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-19 8:02 [Regression x2, 3.13-git] virtio block mq hang, iostat busted on virtio devices Dave Chinner
2013-11-19 10:36 ` Christoph Hellwig
2013-11-19 16:05 ` Jens Axboe [this message]
2013-11-19 16:09 ` Christoph Hellwig
2013-11-19 16:16 ` Jens Axboe
2013-11-19 21:30 ` Dave Chinner
2013-11-19 21:40 ` Jens Axboe
2013-11-19 20:15 ` Jens Axboe
2013-11-19 21:20 ` Jens Axboe
2013-11-19 21:34 ` Dave Chinner
2013-11-19 21:43 ` Jens Axboe
2013-11-19 22:42 ` Jens Axboe
2013-11-19 22:51 ` Jens Axboe
2013-11-19 23:23 ` Dave Chinner
2013-11-19 23:59 ` Jens Axboe
2013-11-20 0:08 ` Jens Axboe
2013-11-20 1:44 ` Shaohua Li
2013-11-20 1:54 ` Jens Axboe
2013-11-20 2:02 ` Jens Axboe
2013-11-20 2:53 ` Dave Chinner
2013-11-20 3:12 ` Jens Axboe
2013-11-20 8:07 ` Christoph Hellwig
2013-11-20 16:21 ` Jens Axboe
2013-11-20 8:04 ` Christoph Hellwig
2013-11-20 16:20 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131119160509.GB21343@kernel.dk \
--to=axboe@kernel.dk \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.