From: Hannes Reinecke <hare@suse.de>
To: Jens Axboe <axboe@fb.com>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
Omar Sandoval <osandov@osandov.com>
Subject: [PATCH] queue stall with blk-mq-sched
Date: Tue, 24 Jan 2017 16:54:46 +0100 [thread overview]
Message-ID: <aa1c23e1-1beb-a26d-3e77-fe78aa281771@suse.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 853 bytes --]
Hi Jens,
I'm trying to debug a queue stall with your blk-mq-sched branch; with my
latest mpt3sas patches fio stops basically directly after starting a
sequential read :-(
I've debugged things and came up with the attached patch; we need to
restart waiters with blk_mq_tag_idle() after completing a tag.
We're already calling blk_mq_tag_busy() when fetching a tag, so I think
calling blk_mq_tag_idle() is required when retiring a tag.
However, even with the attached patch I'm seeing some queue stalls;
looks like they're related to the 'stonewall' statement in fio.
Debugging continues.
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-block-mq-fixup-queue-stall.patch --]
[-- Type: text/x-patch; name="0001-block-mq-fixup-queue-stall.patch", Size: 1440 bytes --]
From 82b15ff40d71aed318f9946881825f9f03ef8f48 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 24 Jan 2017 14:43:09 +0100
Subject: [PATCH] block-mq: fixup queue stall
__blk_mq_alloc_request() calls blk_mq_tag_busy(), which might result
in the queue to become blocked. So we need to call blk_mq_tag_idle()
once the tag is finished to wakeup all waiters on the queue.
Patch is relative to the blk-mq-sched branch
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
block/blk-mq.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 739a292..d52bcb1 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -333,10 +333,12 @@ void __blk_mq_finish_request(struct blk_mq_hw_ctx *hctx, struct blk_mq_ctx *ctx,
{
const int sched_tag = rq->internal_tag;
struct request_queue *q = rq->q;
+ bool unbusy = false;
- if (rq->rq_flags & RQF_MQ_INFLIGHT)
+ if (rq->rq_flags & RQF_MQ_INFLIGHT) {
atomic_dec(&hctx->nr_active);
-
+ unbusy = true;
+ }
wbt_done(q->rq_wb, &rq->issue_stat);
rq->rq_flags = 0;
@@ -346,6 +348,9 @@ void __blk_mq_finish_request(struct blk_mq_hw_ctx *hctx, struct blk_mq_ctx *ctx,
blk_mq_put_tag(hctx, hctx->tags, ctx, rq->tag);
if (sched_tag != -1)
blk_mq_sched_completed_request(hctx, rq);
+ if (unbusy)
+ blk_mq_tag_idle(hctx);
+
blk_queue_exit(q);
}
--
1.8.5.6
next reply other threads:[~2017-01-24 15:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-24 15:54 Hannes Reinecke [this message]
2017-01-24 16:03 ` [PATCH] queue stall with blk-mq-sched Jens Axboe
2017-01-24 18:45 ` Hannes Reinecke
2017-01-24 16:09 ` Jens Axboe
2017-01-24 18:49 ` Hannes Reinecke
2017-01-24 19:55 ` Jens Axboe
2017-01-24 22:06 ` Jens Axboe
2017-01-25 7:39 ` Hannes Reinecke
2017-01-25 8:07 ` Hannes Reinecke
2017-01-25 11:10 ` Hannes Reinecke
2017-01-25 15:52 ` Jens Axboe
2017-01-25 16:57 ` Hannes Reinecke
2017-01-25 17:03 ` Jens Axboe
2017-01-25 17:42 ` Jens Axboe
2017-01-25 22:27 ` Jens Axboe
2017-01-26 16:35 ` Hannes Reinecke
2017-01-26 16:42 ` Jens Axboe
2017-01-26 19:20 ` Jens Axboe
2017-01-27 6:58 ` Hannes Reinecke
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=aa1c23e1-1beb-a26d-3e77-fe78aa281771@suse.de \
--to=hare@suse.de \
--cc=axboe@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=osandov@osandov.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox