|
@@ -1332,6 +1332,10 @@ void sched_init_numa(void)
|
|
|
if (!sched_domains_numa_distance)
|
|
|
return;
|
|
|
|
|
|
+ /* Includes NUMA identity node at level 0. */
|
|
|
+ sched_domains_numa_distance[level++] = curr_distance;
|
|
|
+ sched_domains_numa_levels = level;
|
|
|
+
|
|
|
/*
|
|
|
* O(nr_nodes^2) deduplicating selection sort -- in order to find the
|
|
|
* unique distances in the node_distance() table.
|
|
@@ -1379,8 +1383,7 @@ void sched_init_numa(void)
|
|
|
return;
|
|
|
|
|
|
/*
|
|
|
- * 'level' contains the number of unique distances, excluding the
|
|
|
- * identity distance node_distance(i,i).
|
|
|
+ * 'level' contains the number of unique distances
|
|
|
*
|
|
|
* The sched_domains_numa_distance[] array includes the actual distance
|
|
|
* numbers.
|
|
@@ -1441,10 +1444,19 @@ void sched_init_numa(void)
|
|
|
for (i = 0; sched_domain_topology[i].mask; i++)
|
|
|
tl[i] = sched_domain_topology[i];
|
|
|
|
|
|
+ /*
|
|
|
+ * Add the NUMA identity distance, aka single NODE.
|
|
|
+ */
|
|
|
+ tl[i++] = (struct sched_domain_topology_level){
|
|
|
+ .mask = sd_numa_mask,
|
|
|
+ .numa_level = 0,
|
|
|
+ SD_INIT_NAME(NODE)
|
|
|
+ };
|
|
|
+
|
|
|
/*
|
|
|
* .. and append 'j' levels of NUMA goodness.
|
|
|
*/
|
|
|
- for (j = 0; j < level; i++, j++) {
|
|
|
+ for (j = 1; j < level; i++, j++) {
|
|
|
tl[i] = (struct sched_domain_topology_level){
|
|
|
.mask = sd_numa_mask,
|
|
|
.sd_flags = cpu_numa_flags,
|