public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/numa: Fix NUMA_DIRECT topology identification
@ 2015-08-11  1:20 Aravind Gopalakrishnan
  2015-08-11  1:06 ` Rik van Riel
  2015-08-12 12:37 ` [tip:sched/core] " tip-bot for Aravind Gopalakrishnan
  0 siblings, 2 replies; 3+ messages in thread
From: Aravind Gopalakrishnan @ 2015-08-11  1:20 UTC (permalink / raw)
  To: mingo, peterz, linux-kernel; +Cc: riel

Systems which have all nodes at a distance of at most
1 hop should be identified as 'NUMA_DIRECT'.

However, the scheduler incorrectly identifies it as
'NUMA_BACKPLANE'. This is because 'n' is assigned to
sched_max_numa_distance but the code (mis)interprets it
to mean 'number of hops'.

Rik had actually used sched_domains_numa_levels for detecting
a 'NUMA_DIRECT' topology-
http://marc.info/?l=linux-kernel&m=141279712429834&w=2

But that was changed when he removed the hops table in the
subsequent version-
http://marc.info/?l=linux-kernel&m=141353106106771&w=2

Fixing the issue here.

Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
---
 kernel/sched/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 655557d..e51739e 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6442,8 +6442,10 @@ static void init_numa_topology_type(void)
 
 	n = sched_max_numa_distance;
 
-	if (n <= 1)
+	if (sched_domains_numa_levels <= 1) {
 		sched_numa_topology_type = NUMA_DIRECT;
+		return;
+	}
 
 	for_each_online_node(a) {
 		for_each_online_node(b) {
-- 
2.4.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-12 12:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-11  1:20 [PATCH] sched/numa: Fix NUMA_DIRECT topology identification Aravind Gopalakrishnan
2015-08-11  1:06 ` Rik van Riel
2015-08-12 12:37 ` [tip:sched/core] " tip-bot for Aravind Gopalakrishnan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox