sched/topology: Avoid pointless rebuild
authorPeter Zijlstra <peterz@infradead.org>
Tue, 8 Aug 2017 10:16:24 +0000 (12:16 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 25 Aug 2017 09:12:20 +0000 (11:12 +0200)
commit09e0dd8e0f2e197690d34fed8cb4737114d3dd5f
tree5f44fac23c7fc9f088a99d47d78e98cb0f53b1c3
parent77d1dfda0e79b41894880418f04794e92e4350e2
sched/topology: Avoid pointless rebuild

Fix partition_sched_domains() to try and preserve the existing machine
wide domain instead of unconditionally destroying it. We do this by
attempting to allocate the new single domain, only when that fails to
we reuse the fallback_doms.

When using fallback_doms we need to first destroy and then recreate
because both the old and new could be backed by it.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ofer Levi(SW) <oferle@mellanox.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vineet.Gupta1@synopsys.com <Vineet.Gupta1@synopsys.com>
Cc: rusty@rustcorp.com.au <rusty@rustcorp.com.au>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/topology.c