[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <574870A6.40003@caviumnetworks.com>
Date: Fri, 27 May 2016 09:07:02 -0700
From: David Daney <ddaney@...iumnetworks.com>
To: "Leizhen (ThunderTown)" <thunder.leizhen@...wei.com>
CC: Rob Herring <robh@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
Ganapatrao Kulkarni <gkulkarni@...iumnetworks.com>,
Robert Richter <rrichter@...ium.com>,
"David Daney" <david.daney@...ium.com>,
Frank Rowand <frowand.list@...il.com>,
"Grant Likely" <grant.likely@...aro.org>,
devicetree <devicetree@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Zefan Li <lizefan@...wei.com>, Xinwei Hu <huxinwei@...wei.com>,
Tianhong Ding <dingtianhong@...wei.com>,
Hanjun Guo <guohanjun@...wei.com>
Subject: Re: [PATCH 2/3] of/numa: fix a memory@ dt node can only contains
one memory block
On 05/26/2016 08:36 PM, Leizhen (ThunderTown) wrote:
[...] continue;
> Hi, everybody:
> If some "memory" node contains "numa-node-id", but some others missed. Can we simply ignored it?
> I think we should break out too, and faking to only have node0.
I think if some "memory" nodes contain "numa-node-id" and others do not,
then you have a defective device tree. In this case I think we must
continue with the existing behavior, and indicate failure. This will
cause the architecture specific NUMA code to disable NUMA and force
everything onto a singl pseudo-NUMA-node.
I doubt there is anything to be gained by guessing which NUMA node
orphaned "memory" nodes belong to.
>
>> else if (r)
>> /* some other error */
>> break;
>>
>> r = of_address_to_resource(np, 0, &rsrc);
>> for (i = 0; !r; i++, r = of_address_to_resource(np, i,
>
> But r(non-zero) is just break this loop, the original is break the outer for (;;) loop
>
> How about as below?
>
> for_each_node_by_type(np, "memory") {
> ... ...
>
> for (i = 0; !of_address_to_resource(np, i, &rsrc); i++) {
> r = numa_add_memblk(nid, rsrc.start,
> rsrc.end - rsrc.start + 1);
> if (r)
> goto finished;
> }
>
> if (!i)
> pr_err("NUMA: bad reg property in memory node\n");
> }
>
> finished:
>
>
>> &rsrc)) {
>> r = numa_add_memblk(nid, rsrc.start,
>> rsrc.end - rsrc.start + 1);
>> }
>> }
>> of_node_put(np);
>>
>> return r;
>>
>>
>> Perhaps with a "if (!i && r) pr_err()" for an error message at the end.
>>
>> Rob
>>
>> .
>>
>
Powered by blists - more mailing lists