linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Sagi Grimberg <sagi@grimberg.me>, 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: Tue, 28 Jul 2020 08:25:18 +0200	[thread overview]
Message-ID: <25b94bcf-1730-da16-6a1f-b68ffa4b8970@suse.de> (raw)
In-Reply-To: <bb5ad6b6-c0b2-213e-e16a-a6bfcba394e1@grimberg.me>

On 7/27/20 9:46 PM, Sagi Grimberg wrote:
> 
> 
> 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?

That depends on whether we want to have a fallback to __nvme_find_path() 
or not. With your suggestion we would lose that; I'd rather keep it.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke            Teamlead Storage & Networking
hare@suse.de                               +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

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

  reply	other threads:[~2020-07-28  6:25 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
2020-07-28  6:25     ` Hannes Reinecke [this message]
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=25b94bcf-1730-da16-6a1f-b68ffa4b8970@suse.de \
    --to=hare@suse.de \
    --cc=hch@lst.de \
    --cc=keith.busch@wdc.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=mwilck@suse.com \
    --cc=sagi@grimberg.me \
    /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).