diff options
author | Tim Chen <tim.c.chen@linux.intel.com> | 2016-09-21 12:19:03 -0700 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-09-30 10:53:18 +0200 |
commit | 8f37961cf22304fb286c7604d3a7f6104dcc1283 (patch) | |
tree | 36c12eb9c7a0266424de4d9aa8d26394c09960ea /kernel | |
parent | 536e0e81e0b04305ce40f6cc4299d29dc9bbc673 (diff) | |
download | op-kernel-dev-8f37961cf22304fb286c7604d3a7f6104dcc1283.zip op-kernel-dev-8f37961cf22304fb286c7604d3a7f6104dcc1283.tar.gz |
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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 8bae0cd..af5d4d7 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6552,6 +6552,9 @@ static struct sched_domain_topology_level *sched_domain_topology = void set_sched_topology(struct sched_domain_topology_level *tl) { + if (WARN_ON_ONCE(sched_smp_initialized)) + return; + sched_domain_topology = tl; } |