Re: [PATCH v2] sched/topology: Introduce NUMA identity node sched domain

From: Suravee Suthikulpanit
Date: Wed Aug 23 2017 - 21:14:03 EST


Boris,

Sorry for late reply. I missed this email earlier.

On 8/15/17 00:43, Borislav Petkov wrote:
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 79895ae..2dd5b11 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -1335,6 +1335,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.
@@ -1382,8 +1386,7 @@ void sched_init_numa(void)
return;

/*
- * 'level' contains the number of unique distances, excluding the
- * identity distance node_distance(i,i).
I'm still unclear as to why were we excluding this identity distance
until now and how would that change affect existing systems.

One reason that I can think of is that, on older systems (at least for AMD), L3 sched domain level has the same cpumask as the node level. This is not the case for Zen.

Also, you do use the term "NUMA" pretty loosely in the text - please
take care to explain precisely what kind of node you mean: physical,
logical, ... Don't be afraid to be too verbose.

Thanks.

Mostly, I am referring to the logical NUMA (as described by the SRAT/SLIT), which can change based on how BIOS configures the system. I will update this in V3.

Thanks,
Suravee