All of lore.kernel.org
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH 1/2] nvme: NUMA locality information for fabrics
Date: Mon, 8 Oct 2018 12:04:23 +0200	[thread overview]
Message-ID: <20181008100423.GA6686@lst.de> (raw)
In-Reply-To: <20181005092915.126636-2-hare@suse.de>

> @@ -3055,7 +3057,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
>  	struct gendisk *disk;
>  	struct nvme_id_ns *id;
>  	char disk_name[DISK_NAME_LEN];
> -	int node = dev_to_node(ctrl->dev), flags = GENHD_FL_EXT_DEVT;
> +	int node = ctrl->node_id, flags = GENHD_FL_EXT_DEVT;

I think we can just kill the local node variable now.

> @@ -276,7 +276,7 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl, struct nvme_ns_head *head)
>  	if (!(ctrl->subsys->cmic & (1 << 1)) || !multipath)
>  		return 0;
>  
> -	q = blk_alloc_queue_node(GFP_KERNEL, NUMA_NO_NODE, NULL);
> +	q = blk_alloc_queue_node(GFP_KERNEL, ctrl->node_id, NULL);

This looks a little odd.  We create the mpath disk here, and just
need to pass in the ctrl to do some initialization.  Why would be
allocate the multipath node on the node of the controller?

If there is a good reason it needs to go into a comment, if not
we should drop this hunk.

> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index d668682f91df..b5d37aacf212 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -2517,6 +2517,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  
>  	dev_info(dev->ctrl.device, "pci function %s\n", dev_name(&pdev->dev));
>  
> +	dev->ctrl.node_id = node;
>  	nvme_get_ctrl(&dev->ctrl);
>  	async_schedule(nvme_async_probe, dev);

This changes behavior as node might remain NUMA_NO_NODE when the code
above sets the device node to first_memory_node now when
it would otherwise be NUMA_NO_NODE.  Then again that code makes no
sense to me to start with - Matias added it with the blk-mq conversion,
so maybe he remembers why we do it to start with?  If we want to fix
up nodes like that it seems like we should do it in the driver core
or the PCI core.

  reply	other threads:[~2018-10-08 10:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05  9:29 [PATCH 0/2] nvme: NUMA locality for fabrics Hannes Reinecke
2018-10-05  9:29 ` [PATCH 1/2] nvme: NUMA locality information " Hannes Reinecke
2018-10-08 10:04   ` Christoph Hellwig [this message]
2018-10-08 10:22     ` Matias Bjørling
2018-10-08 10:27       ` Hannes Reinecke
2018-10-08 10:29         ` Matias Bjørling
2018-10-08 23:29           ` Sagi Grimberg
2018-10-08 23:31             ` Sagi Grimberg
2018-10-09  6:14             ` Hannes Reinecke
2018-10-09  6:13       ` Christoph Hellwig
2018-10-08 10:24     ` Hannes Reinecke
2018-10-05  9:29 ` [PATCH 2/2] nvme-multipath: manual NUMA configuration Hannes Reinecke
2018-10-08 10:05   ` Christoph Hellwig
2018-10-08 10:19     ` Hannes Reinecke

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=20181008100423.GA6686@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 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.