All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] nvme: only call synhronize_srcu when clearing current path
@ 2021-09-01  9:25 ` Daniel Wagner
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Wagner @ 2021-09-01  9:25 UTC (permalink / raw)
  To: linux-nvme; +Cc: linux-kernel, Daniel Wagner

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 <dwagner@suse.de>
---
 drivers/nvme/host/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index d3d5cc947525..5b3c74fa89bd 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -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))
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v1] nvme: only call synhronize_srcu when clearing current path
@ 2021-09-01  9:25 ` Daniel Wagner
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Wagner @ 2021-09-01  9:25 UTC (permalink / raw)
  To: linux-nvme; +Cc: linux-kernel, Daniel Wagner

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 <dwagner@suse.de>
---
 drivers/nvme/host/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index d3d5cc947525..5b3c74fa89bd 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -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))
-- 
2.29.2


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v1] nvme: only call synhronize_srcu when clearing current path
  2021-09-01  9:25 ` Daniel Wagner
@ 2021-09-01 12:25   ` Christoph Hellwig
  -1 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2021-09-01 12:25 UTC (permalink / raw)
  To: Daniel Wagner; +Cc: linux-nvme, linux-kernel

Thanks,

applied to nvme-5.15 with a cosmetic fixup to keep the lines from
overflowing.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1] nvme: only call synhronize_srcu when clearing current path
@ 2021-09-01 12:25   ` Christoph Hellwig
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2021-09-01 12:25 UTC (permalink / raw)
  To: Daniel Wagner; +Cc: linux-nvme, linux-kernel

Thanks,

applied to nvme-5.15 with a cosmetic fixup to keep the lines from
overflowing.

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1] nvme: only call synhronize_srcu when clearing current path
  2021-09-01 12:25   ` Christoph Hellwig
@ 2021-09-01 12:44     ` Daniel Wagner
  -1 siblings, 0 replies; 6+ messages in thread
From: Daniel Wagner @ 2021-09-01 12:44 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-nvme, linux-kernel

On Wed, Sep 01, 2021 at 01:25:15PM +0100, Christoph Hellwig wrote:
> 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 :)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1] nvme: only call synhronize_srcu when clearing current path
@ 2021-09-01 12:44     ` Daniel Wagner
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Wagner @ 2021-09-01 12:44 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-nvme, linux-kernel

On Wed, Sep 01, 2021 at 01:25:15PM +0100, Christoph Hellwig wrote:
> 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
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-01 12:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01  9:25 [PATCH v1] nvme: only call synhronize_srcu when clearing current path Daniel Wagner
2021-09-01  9:25 ` Daniel Wagner
2021-09-01 12:25 ` Christoph Hellwig
2021-09-01 12:25   ` Christoph Hellwig
2021-09-01 12:44   ` Daniel Wagner
2021-09-01 12:44     ` Daniel Wagner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.