Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nilay Shroff <nilay@linux.ibm.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-nvme@lists.infradead.org, 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 13:24:47 +0530	[thread overview]
Message-ID: <d1ae6dc4-1898-4afc-bd2c-974ad6702a43@linux.ibm.com> (raw)
In-Reply-To: <20240415072530.GA31958@lst.de>



On 4/15/24 12:55, Christoph Hellwig wrote:
> 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;
> 
> 
Sure. I will incorporate the above comment in the next version of the patch.

Thanks,
--Nilay


      reply	other threads:[~2024-04-15  7:56 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
2024-04-15  7:54   ` Nilay Shroff [this message]

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=d1ae6dc4-1898-4afc-bd2c-974ad6702a43@linux.ibm.com \
    --to=nilay@linux.ibm.com \
    --cc=axboe@fb.com \
    --cc=gjoyce@linux.ibm.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --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