sched/numa: Fix NUMA_DIRECT topology identification
authorAravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
Tue, 11 Aug 2015 01:20:48 +0000 (20:20 -0500)
committerIngo Molnar <mingo@kernel.org>
Wed, 12 Aug 2015 10:06:08 +0000 (12:06 +0200)
commite237882b8f83dd1a0eece1608bcb689d4f4b221b
tree96e25518f0f22929bb00c89d010f1e58780cdf37
parent1eaef888158dc441dcd00c20779251cfa5e756b3
sched/numa: Fix NUMA_DIRECT topology identification

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>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1439256048-3748-1-git-send-email-Aravind.Gopalakrishnan@amd.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/core.c