linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@grimberg.me>
To: Hannes Reinecke <hare@suse.de>, Christoph Hellwig <hch@lst.de>
Cc: linux-nvme@lists.infradead.org, Martin Wilck <mwilck@suse.com>,
	Keith Busch <keith.busch@wdc.com>
Subject: Re: [PATCH 2/2] nvme-multipath: do not fall back to __nvme_find_path() for non-optimized paths
Date: Mon, 27 Jul 2020 12:46:52 -0700	[thread overview]
Message-ID: <bb5ad6b6-c0b2-213e-e16a-a6bfcba394e1@grimberg.me> (raw)
In-Reply-To: <20200727160803.55683-3-hare@suse.de>



On 7/27/20 9:08 AM, Hannes Reinecke wrote:
> When nvme_round_robin_path() finds a valid namespace we should be using it;
> falling back to __nvme_find_path() for non-optimized paths will cause the
> result from nvme_round_robin_path() to be ignored for non-optimized paths.
> 
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
>   drivers/nvme/host/multipath.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
> index fe8f7f123fac..97d3c19b5684 100644
> --- a/drivers/nvme/host/multipath.c
> +++ b/drivers/nvme/host/multipath.c
> @@ -272,8 +272,11 @@ inline struct nvme_ns *nvme_find_path(struct nvme_ns_head *head)
>   	struct nvme_ns *ns;
>   
>   	ns = srcu_dereference(head->current_path[node], &head->srcu);
> -	if (READ_ONCE(head->subsys->iopolicy) == NVME_IOPOLICY_RR && ns)
> +	if (READ_ONCE(head->subsys->iopolicy) == NVME_IOPOLICY_RR && ns) {
>   		ns = nvme_round_robin_path(head, node, ns);
> +		if (ns)
> +			return ns;
> +	}
>   	if (unlikely(!ns || !nvme_path_is_optimized(ns)))
>   		ns = __nvme_find_path(head, node);

Maybe instead of the early return put the following condition on else?

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

  reply	other threads:[~2020-07-27 19:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27 16:08 [PATCH 0/2] nvme-multipath: fixes for non-optimized paths Hannes Reinecke
2020-07-27 16:08 ` [PATCH 1/2] nvme-multipath: fix logic " Hannes Reinecke
2020-07-27 19:42   ` Sagi Grimberg
2020-07-27 16:08 ` [PATCH 2/2] nvme-multipath: do not fall back to __nvme_find_path() " Hannes Reinecke
2020-07-27 19:46   ` Sagi Grimberg [this message]
2020-07-28  6:25     ` Hannes Reinecke
2020-07-28  6:43       ` Sagi Grimberg
2020-07-28  8:02       ` Christoph Hellwig
2020-07-28  8:14         ` Hannes Reinecke
2020-07-28  8:16           ` Christoph Hellwig
2020-07-28  8:18             ` Hannes Reinecke
2020-07-28 10:51 ` [PATCH 0/2] nvme-multipath: fixes " 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=bb5ad6b6-c0b2-213e-e16a-a6bfcba394e1@grimberg.me \
    --to=sagi@grimberg.me \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=keith.busch@wdc.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=mwilck@suse.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;
as well as URLs for NNTP newsgroup(s).