sched/debug: Optimize sched_domain sysctl generation
authorPeter Zijlstra <peterz@infradead.org>
Thu, 10 Aug 2017 15:10:26 +0000 (17:10 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 25 Aug 2017 09:12:20 +0000 (11:12 +0200)
commitbbdacdfed2f5fa50a2cc9f500a36e05990a0837d
tree0ada5cb03b7133b9a42a456cede81e8e1b7a2ba9
parent09e0dd8e0f2e197690d34fed8cb4737114d3dd5f
sched/debug: Optimize sched_domain sysctl generation

Currently we unconditionally destroy all sysctl bits and regenerate
them after we've rebuild the domains (even if that rebuild is a
no-op).

And since we unconditionally (re)build the sysctl for all possible
CPUs, onlining all CPUs gets us O(n^2) time. Instead change this to
only rebuild the bits for CPUs we've actually installed new domains
on.

Reported-by: Ofer Levi(SW) <oferle@mellanox.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/debug.c
kernel/sched/sched.h
kernel/sched/topology.c