linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jianchao.w.wang@oracle.com (Jianchao Wang)
Subject: [PATCH 2/4] blk-mq: retrieve bios before update nr_hw_queues
Date: Tue, 11 Sep 2018 17:48:12 +0800	[thread overview]
Message-ID: <1536659294-2321-3-git-send-email-jianchao.w.wang@oracle.com> (raw)
In-Reply-To: <1536659294-2321-1-git-send-email-jianchao.w.wang@oracle.com>

retrieve bios of requests on queue to drain requests, then:
 - avoid fail requests on dying hw queue
 - needn't depend on storage device to drain the queue any more

Signed-off-by: Jianchao Wang <jianchao.w.wang at oracle.com>
---
 block/blk-mq.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 3d59741..adc14f0 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -3013,7 +3013,15 @@ static void __blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set,
 		return;
 
 	list_for_each_entry(q, &set->tag_list, tag_set_list)
-		blk_mq_freeze_queue(q);
+		blk_freeze_queue_start(q);
+
+	/*
+	 * Wait the percpu ref to be switched to atomic mode.
+	 */
+	synchronize_sched();
+
+	list_for_each_entry(q, &set->tag_list, tag_set_list)
+		blk_mq_sched_retrieve_bios(q);
 	/*
 	 * Sync with blk_mq_queue_tag_busy_iter.
 	 */
-- 
2.7.4

  parent reply	other threads:[~2018-09-11  9:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-11  9:48 [RFC PATCH 0/4] blk-mq: introduce bio retrieve mechanism Jianchao Wang
2018-09-11  9:48 ` [PATCH 1/4] " Jianchao Wang
2018-09-11  9:48 ` Jianchao Wang [this message]
2018-09-11  9:48 ` [PATCH 3/4] nvme-pci: unquiesce queues after update nr_hw_queues Jianchao Wang
2018-09-11  9:48 ` [PATCH 4/4] nvme-pci: discard the cq_vector checking in nvme_queue_rq Jianchao Wang

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=1536659294-2321-3-git-send-email-jianchao.w.wang@oracle.com \
    --to=jianchao.w.wang@oracle.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;
as well as URLs for NNTP newsgroup(s).