From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH] nvme: Update node paths after adding new path
Date: Fri, 5 Oct 2018 09:49:37 -0600 [thread overview]
Message-ID: <20181005154937.24198-1-keith.busch@intel.com> (raw)
The nvme namespace paths were being updated only when the current path
was not set or nonoptimized. If a new path comes online that is a better
path for its NUMA node, the multipath selector may continue using the
previously set path on a potentially further node.
This patch re-runs the path assignment after successfully adding a new
optimized path.
Signed-off-by: Keith Busch <keith.busch at intel.com>
---
drivers/nvme/host/multipath.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 52987052b7fc..fc3c5c2b3eca 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -321,6 +321,14 @@ static void nvme_mpath_set_live(struct nvme_ns *ns)
device_add_disk(&head->subsys->dev, head->disk,
nvme_ns_id_attr_groups);
+ if (nvme_path_is_optimized(ns)) {
+ int node, srcu_idx;
+
+ srcu_idx = srcu_read_lock(&head->srcu);
+ for_each_node(node)
+ __nvme_find_path(head, node);
+ srcu_read_unlock(&head->srcu, srcu_idx);
+ }
kblockd_schedule_work(&ns->head->requeue_work);
}
--
2.14.4
next reply other threads:[~2018-10-05 15:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-05 15:49 Keith Busch [this message]
2018-10-05 18:10 ` [PATCH] nvme: Update node paths after adding new path Sagi Grimberg
2018-10-05 18:57 ` Keith Busch
2018-10-05 19:33 ` Sagi Grimberg
2018-10-08 9:55 ` Christoph Hellwig
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=20181005154937.24198-1-keith.busch@intel.com \
--to=keith.busch@intel.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