nvme: only call synhronize_srcu when clearing current path
PATCH 1/1 nvme: only call synhronize_srcu when clearing current path
The function nmve_mpath_clear_current_path returns true if the current path has changed. In this case we have to wait for all concurrent submissions to finish. But if we didn't change the current path, there is no point in waiting for another RCU period to finish.
Signed-off-by Daniel Wagner <[email protected]>
--- drivers/nvme/host/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/core.c +2 -2
@@ -3814,8 +3814,8 @@ static void nvme_ns_remove(struct nvme_ns *ns)mutex_unlock (&ns->ctrl->subsys->lock);synchronize_rcu ();/* guarantee not available in head->list */ -nvme_mpath_clear_current_path (ns); -synchronize_srcu (&ns->head->srcu);/* wait for concurrent submissions */ +if (nvme_mpath_clear_current_path (ns)) +synchronize_srcu (&ns->head->srcu);/* wait for concurrent submissions */ if (ns->disk->flags &GENHD_FL_UP ) {if (!nvme_ns_head_multipath (ns->head))
Signature · 1 line
2.29.2
Christoph Hellwig
AppliedThanks,
applied to nvme-5.15 with a cosmetic fixup to keep the lines from overflowing.
Quoted 2 lines · Christoph Hellwig
applied to nvme-5.15 with a cosmetic fixup to keep the lines from overflowing.
Thanks, forgot to check the length (I guess I should set max line length back to 80). Looks way better anyway :)
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme