On 26.04.2023 07:33, Henry Wang wrote:
>> -----Original Message-----
>> From: Jan Beulich <[email protected]>
>>
>>> +        /* Get opposite way distance */
>>> +        opposite = __node_distance(to, from);
>>> +        /* The default value in node_distance_map is NUMA_NO_DISTANCE
>> */
>>> +        if ( opposite == NUMA_NO_DISTANCE )
>>
>> And the matrix you're reading from can't hold NUMA_NO_DISTANCE entries?
>> I ask because you don't check this above; you only check against
>> NUMA_LOCAL_DISTANCE.
> 
> My understanding for the purpose of this part of code is to check if the 
> opposite
> way distance has already been set, so we need to compare the opposite way
> distance with the default value NUMA_NO_DISTANCE here.
> 
> Back to your question, I can see your point of the question. However I don't 
> think
> NUMA_NO_DISTANCE is a valid value to describe the node distance in the device
> tree. This is because I hunted down the previous discussions and found [2] 
> about
> we should try to keep consistent between the value used in device tree and 
> ACPI
> tables. From the ACPI spec, 0xFF, i.e. NUMA_NO_DISTANCE means unreachable.
> I think this is also the reason why NUMA_NO_DISTANCE can be used as the 
> default
> value of the distance map, otherwise we won't have any value to use.

The [2] link you provided discusses NUMA_LOCAL_DISTANCE. Looking at
Linux'es Documentation/devicetree/numa.txt, there's no mention of an
upper bound on the distance values. It only says that on the diagonal
entries should be 10 (i.e. matching ACPI, without really saying so).

Jan

Reply via email to