linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH] nvme: take node locality into account when selecting a path
Date: Mon, 1 Oct 2018 01:01:44 +0200	[thread overview]
Message-ID: <20180930230144.GB20144@lst.de> (raw)
In-Reply-To: <8b06c066-3a9a-84e6-2439-159d12ed64a2@grimberg.me>

On Fri, Sep 28, 2018@03:31:09PM -0700, Sagi Grimberg wrote:
>
>> +static struct nvme_ns *__nvme_find_path(struct nvme_ns_head *head, int node)
>> +{
>> +	int found_distance = INT_MAX, fallback_distance = INT_MAX, distance;
>> +	struct nvme_ns *found = NULL, *fallback = NULL, *ns;
>>     	list_for_each_entry_rcu(ns, &head->list, siblings) {
>>   		if (ns->ctrl->state != NVME_CTRL_LIVE ||
>>   		    test_bit(NVME_NS_ANA_PENDING, &ns->flags))
>>   			continue;
>> +
>> +		distance = node_distance(node, dev_to_node(ns->ctrl->dev));
>
> Can we make this useful also for fabrics who have device affinity
> knowledge? ctrl->dev is useless for fabrics...
>
> Perhaps make it a ctrl->ops->devnode() or something?

I'd prefer a pointer of field (we could copy the node over) over
an indirect call.  But I'll happily leave that to the person that
actually implements the functionality to fabrics.

  reply	other threads:[~2018-09-30 23:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-27 23:05 [PATCH] nvme: take node locality into account when selecting a path Christoph Hellwig
2018-09-28 14:12 ` Keith Busch
2018-09-28 22:31 ` Sagi Grimberg
2018-09-30 23:01   ` Christoph Hellwig [this message]
2018-10-01 19:45     ` Sagi Grimberg
2018-10-02 17:30       ` Hannes Reinecke
2018-10-02 17:39         ` Christoph Hellwig
2018-10-03  8:56           ` Hannes Reinecke
2018-10-03 12:43             ` Christoph Hellwig
2018-10-04  1:30             ` Sagi Grimberg
2018-10-04 15:40               ` Hannes Reinecke
2018-09-29 12:09 ` Hannes Reinecke
2018-09-30 22:59   ` 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=20180930230144.GB20144@lst.de \
    --to=hch@lst.de \
    /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).