sched/core, x86/topology: Fix NUMA in package topology bug
authorTim Chen <tim.c.chen@linux.intel.com>
Wed, 21 Sep 2016 19:19:03 +0000 (12:19 -0700)
committerIngo Molnar <mingo@kernel.org>
Fri, 30 Sep 2016 08:53:18 +0000 (10:53 +0200)
commit8f37961cf22304fb286c7604d3a7f6104dcc1283
tree36c12eb9c7a0266424de4d9aa8d26394c09960ea
parent536e0e81e0b04305ce40f6cc4299d29dc9bbc673
sched/core, x86/topology: Fix NUMA in package topology bug

Current code can call set_cpu_sibling_map() and invoke sched_set_topology()
more than once (e.g. on CPU hot plug).  When this happens after
sched_init_smp() has been called, we lose the NUMA topology extension to
sched_domain_topology in sched_init_numa().  This results in incorrect
topology when the sched domain is rebuilt.

This patch fixes the bug and issues warning if we call sched_set_topology()
after sched_init_smp().

Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
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>
Cc: bp@suse.de
Cc: jolsa@redhat.com
Cc: rjw@rjwysocki.net
Link: http://lkml.kernel.org/r/1474485552-141429-2-git-send-email-srinivas.pandruvada@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/smpboot.c
kernel/sched/core.c