lkml.org 
[lkml]   [2021]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/3] powerpc/numa: Populate distance map correctly
Date
On 20/05/21 21:14, Srikar Dronamraju wrote:
> +int arch_populate_distance_map(unsigned long *distance_map)
> +{
> + int i;
> + int distance = LOCAL_DISTANCE;
> +
> + bitmap_set(distance_map, distance, 1);
> +
> + if (!form1_affinity) {
> + bitmap_set(distance_map, REMOTE_DISTANCE, 1);
> + return 0;
> + }
> +
> + for (i = 0; i < distance_ref_points_depth; i++) {
> + distance *= 2;
> + bitmap_set(distance_map, distance, 1);

Do you have guarantees your distance values will always be in the form of

LOCAL_DISTANCE * 2^i

because that certainly isn't true for x86/arm64.

> + }
> + return 0;
> +}
> +
> /*
> * Returns nid in the range [0..nr_node_ids], or -1 if no useful NUMA
> * info is found.
> --
> 2.27.0

\
 
 \ /
  Last update: 2021-05-24 16:17    [W:0.083 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site