From: Christoph Hellwig <hch@lst.de>
To: Nilay Shroff <nilay@linux.ibm.com>
Cc: linux-nvme@lists.infradead.org, hch@lst.de, kbusch@kernel.org,
sagi@grimberg.me, gjoyce@linux.ibm.com, axboe@fb.com
Subject: Re: [PATCH] nvme: find numa distance only if controller has valid numa id
Date: Mon, 15 Apr 2024 09:25:30 +0200 [thread overview]
Message-ID: <20240415072530.GA31958@lst.de> (raw)
In-Reply-To: <20240413090614.678353-1-nilay@linux.ibm.com>
On Sat, Apr 13, 2024 at 02:34:36PM +0530, Nilay Shroff wrote:
> continue;
>
> - if (READ_ONCE(head->subsys->iopolicy) == NVME_IOPOLICY_NUMA)
> - distance = node_distance(node, ns->ctrl->numa_node);
> - else
> - distance = LOCAL_DISTANCE;
> + if (READ_ONCE(head->subsys->iopolicy) == NVME_IOPOLICY_NUMA) {
> + if (ns->ctrl->numa_node != NUMA_NO_NODE)
> + distance = node_distance(node, ns->ctrl->numa_node);
> + }
Please avoid the overly long line. This could be easily done by keeping
the old code structure, which IMHO is more readable anyway:
if (ns->ctrl->numa_node != NUMA_NO_NODE &&
READ_ONCE(head->subsys->iopolicy) == NVME_IOPOLICY_NUMA)
distance = node_distance(node, ns->ctrl->numa_node);
else
distance = LOCAL_DISTANCE;
next prev parent reply other threads:[~2024-04-15 7:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-13 9:04 [PATCH] nvme: find numa distance only if controller has valid numa id Nilay Shroff
2024-04-14 8:30 ` Sagi Grimberg
2024-04-14 11:02 ` Nilay Shroff
2024-04-15 8:55 ` Sagi Grimberg
2024-04-15 9:30 ` Nilay Shroff
2024-04-15 10:04 ` Sagi Grimberg
2024-04-15 14:39 ` Hannes Reinecke
2024-04-15 16:56 ` Keith Busch
2024-04-16 8:06 ` Nilay Shroff
2024-04-15 7:25 ` Christoph Hellwig [this message]
2024-04-15 7:54 ` Nilay Shroff
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=20240415072530.GA31958@lst.de \
--to=hch@lst.de \
--cc=axboe@fb.com \
--cc=gjoyce@linux.ibm.com \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=nilay@linux.ibm.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