Daniel Henrique Barboza <danielhb...@gmail.com> writes:
> Hello,
>
>
> I didn't find an explanation about the 'double the distance' logic in
> 'git log' or anywhere in the kernel docs:
>
>
> (arch/powerpc/mm/numa.c, __node_distance()):

Adding more context:

  int distance = LOCAL_DISTANCE;
  ...

> for (i = 0; i < distance_ref_points_depth; i++) {
>       if (distance_lookup_table[a][i] == distance_lookup_table[b][i])
>               break;
>
>       /* Double the distance for each NUMA level */
>       distance *= 2;
> }

And:

#define LOCAL_DISTANCE          10
#define REMOTE_DISTANCE         20


So AFAICS the doubling is just a way to ensure we go from LOCAL_DISTANCE
to REMOTE_DISTANCE at the first level, and then after that it's fairly
arbitrary.

cheers

Reply via email to