public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Christian Borntraeger <borntraeger@de.ibm.com>,
	Ming Lei <ming.lei@redhat.com>
Cc: linux-block@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>,
	Stefan Haberland <sth@linux.vnet.ibm.com>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues()
Date: Wed, 28 Mar 2018 08:38:59 -0600	[thread overview]
Message-ID: <4c774763-3c47-f930-a44e-5fcc5ae5afa0@kernel.dk> (raw)
In-Reply-To: <ebd41c63-5b64-23a7-1914-4abdedf3c9b2@de.ibm.com>

On 3/28/18 1:45 AM, Christian Borntraeger wrote:
> FWIW, this patch does not fix the issue for me:

Looks like I didn't do the delayed path. How about the below?


diff --git a/block/blk-mq.c b/block/blk-mq.c
index 16e83e6df404..fd663ae1094c 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1302,10 +1302,23 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list,
 	return (queued + errors) != 0;
 }
 
+static bool blk_mq_bail_unmapped(struct blk_mq_hw_ctx *hctx)
+{
+	/*
+	 * Warn if the queue isn't mapped AND we have pending IO. Not being
+	 * mapped isn't necessarily a huge issue, if we don't have pending IO.
+	 */
+	return !blk_mq_hw_queue_mapped(hctx) &&
+		!WARN_ON_ONCE(blk_mq_hctx_has_pending(hctx));
+}
+
 static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
 {
 	int srcu_idx;
 
+	if (blk_mq_bail_unmapped(hctx))
+		return;
+
 	/*
 	 * We should be running this queue from one of the CPUs that
 	 * are mapped to it.
@@ -1399,9 +1412,8 @@ static int blk_mq_hctx_next_cpu(struct blk_mq_hw_ctx *hctx)
 static void __blk_mq_delay_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async,
 					unsigned long msecs)
 {
-	if (WARN_ON_ONCE(!blk_mq_hw_queue_mapped(hctx)))
+	if (blk_mq_bail_unmapped(hctx))
 		return;
-
 	if (unlikely(blk_mq_hctx_stopped(hctx)))
 		return;
 

-- 
Jens Axboe

  reply	other threads:[~2018-03-28 14:38 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28  1:20 [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues() Ming Lei
2018-03-28  3:22 ` Jens Axboe
2018-03-28  7:45   ` Christian Borntraeger
2018-03-28 14:38     ` Jens Axboe [this message]
2018-03-28 14:53       ` Jens Axboe
2018-03-28 15:38         ` Christian Borntraeger
2018-03-28 15:26     ` Ming Lei
2018-03-28 15:36       ` Christian Borntraeger
2018-03-28 15:44         ` Christian Borntraeger
2018-03-29  2:00         ` Ming Lei
2018-03-29  7:23           ` Christian Borntraeger
2018-03-29  9:09             ` Christian Borntraeger
2018-03-29  9:40               ` Ming Lei
2018-03-29 10:10                 ` Christian Borntraeger
2018-03-29 10:48                   ` Ming Lei
2018-03-29 10:49                     ` Christian Borntraeger
2018-03-29 11:43                       ` Ming Lei
2018-03-29 11:49                         ` Christian Borntraeger
2018-03-30  2:53                           ` Ming Lei
2018-04-04  8:18                             ` Christian Borntraeger
2018-04-05 16:05                               ` Ming Lei
2018-04-05 16:11                                 ` Ming Lei
2018-04-05 17:39                                   ` Christian Borntraeger
2018-04-05 17:43                                     ` Christian Borntraeger
2018-04-06  8:41                                     ` Ming Lei
2018-04-06  8:51                                       ` Christian Borntraeger
2018-04-06  8:53                                         ` Christian Borntraeger
2018-04-06  9:23                                         ` Ming Lei
2018-04-06 10:19                                           ` Christian Borntraeger
2018-04-06 13:41                                             ` Ming Lei
2018-04-06 14:26                                               ` Christian Borntraeger
2018-04-06 14:58                                                 ` Ming Lei
2018-04-06 15:11                                                   ` Christian Borntraeger
2018-04-06 15:40                                                     ` Ming Lei
2018-04-06 11:37                                           ` Christian Borntraeger
2018-04-06  8:35                                 ` Christian Borntraeger
2018-03-29  9:52             ` Ming Lei
2018-03-29 10:11               ` Christian Borntraeger
2018-03-29 10:12                 ` Christian Borntraeger
2018-03-29 10:13               ` Ming Lei

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=4c774763-3c47-f930-a44e-5fcc5ae5afa0@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=borntraeger@de.ibm.com \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=sth@linux.vnet.ibm.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