summaryrefslogtreecommitdiff
path: root/drivers/nvme/host/multipath.c
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2018-10-05 09:49:37 -0600
committerChristoph Hellwig <hch@lst.de>2018-10-17 08:58:22 +0200
commit886fabf693263e8651c0c4ab84fc626ad6d3a6e7 (patch)
treee0aa72950198f47101c902e6c42c69be817190f7 /drivers/nvme/host/multipath.c
parent0585b75437d335c6580066c1ab9ea3092139df32 (diff)
nvme: update node paths after adding new path
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@intel.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/host/multipath.c')
-rw-r--r--drivers/nvme/host/multipath.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 52987052b7fc..5e3cc8c59a39 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -321,6 +321,15 @@ 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);
}