From: Sagi Grimberg <sagi@grimberg.me>
To: linux-nvme@lists.infradead.org, Christoph Hellwig <hch@lst.de>,
Keith Busch <kbusch@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>, Chao Leng <lengchao@huawei.com>
Subject: [PATCH rfc v2 3/4] nvme-core: reduce io failover time
Date: Fri, 24 Jul 2020 16:06:03 -0700 [thread overview]
Message-ID: <20200724230604.34625-4-sagi@grimberg.me> (raw)
In-Reply-To: <20200724230604.34625-1-sagi@grimberg.me>
From: Chao Leng <lengchao@huawei.com>
We test nvme over roce fail over with multipath when 1000 namespaces
configured, io pause more than 10 seconds. The reason: nvme_stop_queues
will quiesce all queues for each namespace when io timeout cause path
error. Quiesce queue wait all ongoing dispatches finished through
synchronize_rcu, need more than 10 milliseconds for each wait,
thus io pause more than 10 seconds.
To reduce io pause time, nvme_stop_queues use
blk_mq_quiesce_queue_nowait to quiesce the queue, nvme_stop_queues wait
all ongoing dispatches completed after all queues has been quiesced.
Signed-off-by: Chao Leng <lengchao@huawei.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
---
drivers/nvme/host/core.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 2ae8caa4e25f..e3fae68f7de6 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4548,8 +4548,13 @@ void nvme_stop_queues(struct nvme_ctrl *ctrl)
down_read(&ctrl->namespaces_rwsem);
list_for_each_entry(ns, &ctrl->namespaces, list)
- blk_mq_quiesce_queue(ns->queue);
+ blk_mq_quiesce_queue_nowait(ns->queue);
up_read(&ctrl->namespaces_rwsem);
+ /*
+ * BLK_MQ_F_BLOCKING drivers should never call us
+ */
+ WARN_ON_ONCE(ctrl->tagset.flags & BLK_MQ_F_BLOCKING);
+ synchronize_rcu();
}
EXPORT_SYMBOL_GPL(nvme_stop_queues);
--
2.25.1
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2020-07-24 23:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-24 23:06 [PATCH rfc v2 0/4] improve quiesce time for large amount of namespaces Sagi Grimberg
2020-07-24 23:06 ` [PATCH rfc v2 1/4] blk-mq: add async quiesce interface for blocking hw queues Sagi Grimberg
2020-07-25 7:03 ` Chao Leng
2020-07-25 17:35 ` Sagi Grimberg
2020-07-24 23:06 ` [PATCH rfc v2 2/4] nvme: improve quiesce for blocking queues Sagi Grimberg
2020-07-24 23:06 ` Sagi Grimberg [this message]
2020-07-24 23:15 ` [PATCH rfc v2 3/4] nvme-core: reduce io failover time Sagi Grimberg
2020-07-25 8:51 ` Chao Leng
2020-07-24 23:06 ` [PATCH for-testing v2 4/4] nvme-rdma: use blocking quiesce interface Sagi Grimberg
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=20200724230604.34625-4-sagi@grimberg.me \
--to=sagi@grimberg.me \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=lengchao@huawei.com \
--cc=linux-nvme@lists.infradead.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 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).