Re: [PATCH] x86, numa: seperate alloc_numa_distance from numa_reset_distance.

From: Cyrill Gorcunov
Date: Wed Feb 16 2011 - 16:44:33 EST


On 02/16/2011 11:57 PM, Yinghai Lu wrote:

alloc code is much bigger the setting self.

...
+
+ numa_distance = __va(phys);
+ numa_distance_cnt = cnt;
+
+ /* fill with the default distances */
+ for (i = 0; i< cnt; i++)
+ for (j = 0; j< cnt; j++)
+ numa_distance[i * cnt + j] = i == j ?
+ LOCAL_DISTANCE : REMOTE_DISTANCE;
+ printk(KERN_DEBUG "NUMA: Initialized distance table, cnt=%d\n", cnt);
+}
+

Hi Yinghai, btw would it be convenient to use node_distance() helper here
(since this snippet is touched anyway and there is a big merging of numa
code), ie

/* fill with the default distances */
for (i = 0; i < cnt; i++)
for (j = 0; j < cnt; j++)
numa_distance[i * cnt + j] = node_distance(i, j);

though it should be patch on top of yours to not mix with plain code move
--
Cyrill
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/