From: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
To: Vaibhav Jain <vaibhav@linux.ibm.com>,
npiggin@gmail.com, paulus@samba.org, mpe@ellerman.id.au
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: ["RFC PATCH" 2/2] powerpc/mm: Conslidate numa_enable check and min_common_depth check
Date: Sat, 29 Jun 2019 21:24:59 +0530 [thread overview]
Message-ID: <ddae176b-6ae2-224e-bb23-1bf31e102d0a@linux.ibm.com> (raw)
In-Reply-To: <87imsos8n5.fsf@vajain21.in.ibm.com>
On 6/29/19 9:09 PM, Vaibhav Jain wrote:
> "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> writes:
>
>> Update min_common_depth = -1 if numa is disabled. This
>> help us to avoid checking for both in different code paths.
>>
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
>> ---
>> arch/powerpc/mm/numa.c | 9 +++++----
>> 1 file changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
>> index f6d68baeaa96..c84062a390cc 100644
>> --- a/arch/powerpc/mm/numa.c
>> +++ b/arch/powerpc/mm/numa.c
>> @@ -212,7 +212,7 @@ static int associativity_to_nid(const __be32 *associativity)
>> {
>> int nid = NUMA_NO_NODE;
>>
>> - if (min_common_depth == -1 || !numa_enabled)
>> + if (min_common_depth == -1)
>> goto out;
>>
>> if (of_read_number(associativity, 1) >= min_common_depth)
>> @@ -625,6 +625,7 @@ static int __init parse_numa_properties(void)
>>
>> if (numa_enabled == 0) {
>> printk(KERN_WARNING "NUMA disabled by user\n");
>> + min_common_depth = -1;
>> return -1;
>> }
>
> I would prefer updating the definition of variable 'min_common_depth' to
>
> static int min_common_depth = -1;
>
> This would handle the case where someone calls 'associativity_to_nid()' and
> other functions that read 'min_common_depth' and get an invalid result
> back. And also handle the case where kernel is booted with 'numa = off'.
>
Sure. As mentioned in another email, I am wondering whether all that
min_common_depth check should be if !numa_enabled. That makes it much
easy to read. I will respin once i get more clarity on
of_drconf_to_nid_single usage.
> Also the init value 'min_common_depth == 0' indicates that the
> first word in "ibm,associativity" array represents the node-id which is
> wrong. Instead its the length of the "ibm,associativity" array.
>
-aneesh
next prev parent reply other threads:[~2019-06-29 15:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-29 8:36 ["RFC PATCH" 1/2] powerpc/mm: Fix node look up with numa=off boot Aneesh Kumar K.V
2019-06-29 8:36 ` ["RFC PATCH" 2/2] powerpc/mm: Conslidate numa_enable check and min_common_depth check Aneesh Kumar K.V
2019-06-29 9:06 ` Aneesh Kumar K.V
2019-06-29 15:39 ` Vaibhav Jain
2019-06-29 15:54 ` Aneesh Kumar K.V [this message]
2019-06-29 9:03 ` ["RFC PATCH" 1/2] powerpc/mm: Fix node look up with numa=off boot Aneesh Kumar K.V
2019-07-01 16:42 ` Nathan Lynch
2019-07-02 2:45 ` Aneesh Kumar K.V
2019-07-02 15:57 ` Nathan Lynch
2019-07-04 14:29 ` Michael Ellerman
2019-07-09 14:56 ` Nathan Lynch
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=ddae176b-6ae2-224e-bb23-1bf31e102d0a@linux.ibm.com \
--to=aneesh.kumar@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=paulus@samba.org \
--cc=vaibhav@linux.ibm.com \
/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).