* [PATCH] nvme-fc: set numa_node after nvme_init_ctrl
@ 2023-12-19 17:49 Keith Busch
2023-12-19 20:31 ` Sagi Grimberg
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Keith Busch @ 2023-12-19 17:49 UTC (permalink / raw)
To: linux-nvme, james.smart; +Cc: sagi, hch, Keith Busch
From: Keith Busch <kbusch@kernel.org>
nvme_init_ctrl() always sets ctrl->numa_node to NUMA_NO_NODE. Set the
desired value after that function call so it won't be overwritten.
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
drivers/nvme/host/fc.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 9f9a3b35dc64d..2de506d58593b 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -3509,10 +3509,6 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
ctrl->ctrl.opts = opts;
ctrl->ctrl.nr_reconnects = 0;
- if (lport->dev)
- ctrl->ctrl.numa_node = dev_to_node(lport->dev);
- else
- ctrl->ctrl.numa_node = NUMA_NO_NODE;
INIT_LIST_HEAD(&ctrl->ctrl_list);
ctrl->lport = lport;
ctrl->rport = rport;
@@ -3558,6 +3554,11 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
if (ret)
goto out_free_queues;
+ if (lport->dev)
+ ctrl->ctrl.numa_node = dev_to_node(lport->dev);
+ else
+ ctrl->ctrl.numa_node = NUMA_NO_NODE;
+
/* at this point, teardown path changes to ref counting on nvme ctrl */
ret = nvme_alloc_admin_tag_set(&ctrl->ctrl, &ctrl->admin_tag_set,
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] nvme-fc: set numa_node after nvme_init_ctrl
2023-12-19 17:49 [PATCH] nvme-fc: set numa_node after nvme_init_ctrl Keith Busch
@ 2023-12-19 20:31 ` Sagi Grimberg
2023-12-20 3:15 ` Jens Axboe
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Sagi Grimberg @ 2023-12-19 20:31 UTC (permalink / raw)
To: Keith Busch, linux-nvme, james.smart; +Cc: hch, Keith Busch
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] nvme-fc: set numa_node after nvme_init_ctrl
2023-12-19 17:49 [PATCH] nvme-fc: set numa_node after nvme_init_ctrl Keith Busch
2023-12-19 20:31 ` Sagi Grimberg
@ 2023-12-20 3:15 ` Jens Axboe
2023-12-20 6:37 ` Christoph Hellwig
2023-12-20 13:43 ` Max Gurtovoy
3 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2023-12-20 3:15 UTC (permalink / raw)
To: Keith Busch, linux-nvme, james.smart; +Cc: sagi, hch, Keith Busch
On 12/19/23 10:49 AM, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> nvme_init_ctrl() always sets ctrl->numa_node to NUMA_NO_NODE. Set the
> desired value after that function call so it won't be overwritten.
Reviewed-by: Jens Axboe <axboe@kernel.dk>
--
Jens Axboe
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] nvme-fc: set numa_node after nvme_init_ctrl
2023-12-19 17:49 [PATCH] nvme-fc: set numa_node after nvme_init_ctrl Keith Busch
2023-12-19 20:31 ` Sagi Grimberg
2023-12-20 3:15 ` Jens Axboe
@ 2023-12-20 6:37 ` Christoph Hellwig
2023-12-20 13:43 ` Max Gurtovoy
3 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2023-12-20 6:37 UTC (permalink / raw)
To: Keith Busch; +Cc: linux-nvme, james.smart, sagi, hch, Keith Busch
On Tue, Dec 19, 2023 at 09:49:34AM -0800, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> nvme_init_ctrl() always sets ctrl->numa_node to NUMA_NO_NODE. Set the
> desired value after that function call so it won't be overwritten.
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] nvme-fc: set numa_node after nvme_init_ctrl
2023-12-19 17:49 [PATCH] nvme-fc: set numa_node after nvme_init_ctrl Keith Busch
` (2 preceding siblings ...)
2023-12-20 6:37 ` Christoph Hellwig
@ 2023-12-20 13:43 ` Max Gurtovoy
2023-12-21 17:21 ` Keith Busch
3 siblings, 1 reply; 6+ messages in thread
From: Max Gurtovoy @ 2023-12-20 13:43 UTC (permalink / raw)
To: Keith Busch, linux-nvme, james.smart; +Cc: sagi, hch, Keith Busch
Hi Keith,
On 19/12/2023 19:49, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> nvme_init_ctrl() always sets ctrl->numa_node to NUMA_NO_NODE. Set the
> desired value after that function call so it won't be overwritten.
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> drivers/nvme/host/fc.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
> index 9f9a3b35dc64d..2de506d58593b 100644
> --- a/drivers/nvme/host/fc.c
> +++ b/drivers/nvme/host/fc.c
> @@ -3509,10 +3509,6 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
>
> ctrl->ctrl.opts = opts;
> ctrl->ctrl.nr_reconnects = 0;
> - if (lport->dev)
> - ctrl->ctrl.numa_node = dev_to_node(lport->dev);
> - else
> - ctrl->ctrl.numa_node = NUMA_NO_NODE;
> INIT_LIST_HEAD(&ctrl->ctrl_list);
> ctrl->lport = lport;
> ctrl->rport = rport;
> @@ -3558,6 +3554,11 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
> if (ret)
> goto out_free_queues;
>
> + if (lport->dev)
> + ctrl->ctrl.numa_node = dev_to_node(lport->dev);
> + else
> + ctrl->ctrl.numa_node = NUMA_NO_NODE;
We don't need the "else" clause, it is initialized to NUMA_NO_NODE.
Otherwise,
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
> +
> /* at this point, teardown path changes to ref counting on nvme ctrl */
>
> ret = nvme_alloc_admin_tag_set(&ctrl->ctrl, &ctrl->admin_tag_set,
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] nvme-fc: set numa_node after nvme_init_ctrl
2023-12-20 13:43 ` Max Gurtovoy
@ 2023-12-21 17:21 ` Keith Busch
0 siblings, 0 replies; 6+ messages in thread
From: Keith Busch @ 2023-12-21 17:21 UTC (permalink / raw)
To: Max Gurtovoy; +Cc: Keith Busch, linux-nvme, james.smart, sagi, hch
On Wed, Dec 20, 2023 at 03:43:03PM +0200, Max Gurtovoy wrote:
> On 19/12/2023 19:49, Keith Busch wrote:
> > + if (lport->dev)
> > + ctrl->ctrl.numa_node = dev_to_node(lport->dev);
> > + else
> > + ctrl->ctrl.numa_node = NUMA_NO_NODE;
>
> We don't need the "else" clause, it is initialized to NUMA_NO_NODE.
This was just moving the existing hunk, but your suggestion is a nice
bonus cleanup. I've folded it in and applied for nvme-6.8. Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-12-21 17:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-19 17:49 [PATCH] nvme-fc: set numa_node after nvme_init_ctrl Keith Busch
2023-12-19 20:31 ` Sagi Grimberg
2023-12-20 3:15 ` Jens Axboe
2023-12-20 6:37 ` Christoph Hellwig
2023-12-20 13:43 ` Max Gurtovoy
2023-12-21 17:21 ` Keith Busch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox