msrasmussen and Ingo Molnar sched/topology: Add SD_ASYM_CPUCAPACITY flag detection
The SD_ASYM_CPUCAPACITY sched_domain flag is supposed to mark the
sched_domain in the hierarchy where all CPU capacities are visible for
any CPU's point of view on asymmetric CPU capacity systems. The
scheduler can then take to take capacity asymmetry into account when
balancing at this level. It also serves as an indicator for how wide
task placement heuristics have to search to consider all available CPU
capacities as asymmetric systems might often appear symmetric at
smallest level(s) of the sched_domain hierarchy.

The flag has been around for while but so far only been set by
out-of-tree code in Android kernels. One solution is to let each
architecture provide the flag through a custom sched_domain topology
array and associated mask and flag functions. However,
SD_ASYM_CPUCAPACITY is special in the sense that it depends on the
capacity and presence of all CPUs in the system, i.e. when hotplugging
all CPUs out except those with one particular CPU capacity the flag
should disappear even if the sched_domains don't collapse. Similarly,
the flag is affected by cpusets where load-balancing is turned off.
Detecting when the flags should be set therefore depends not only on
topology information but also the cpuset configuration and hotplug
state. The arch code doesn't have easy access to the cpuset
configuration.

Instead, this patch implements the flag detection in generic code where
cpusets and hotplug state is already taken care of. All the arch is
responsible for is to implement arch_scale_cpu_capacity() and force a
full rebuild of the sched_domain hierarchy if capacities are updated,
e.g. later in the boot process when cpufreq has initialized.

Signed-off-by: Morten Rasmussen <morten.rasmussen@arm.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>
Cc: dietmar.eggemann@arm.com
Cc: valentin.schneider@arm.com
Cc: vincent.guittot@linaro.org
Link: http://lkml.kernel.org/r/1532093554-30504-2-git-send-email-morten.rasmussen@arm.com
[ Fixed 'CPU' capitalization. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Latest commit 05484e0 Jul 20, 2018
Permalink
..
Failed to load latest commit information.
autogroup.h License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017
clock.h License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017
coredump.h mm, oom_reaper: fix memory corruption Dec 15, 2017
cpufreq.h sched/cpufreq: Provide migration hint Mar 9, 2018
cputime.h Merge branch 'for-4.15' of git://git.kernel.org/pub/scm/linux/kernel/… Nov 15, 2017
deadline.h sched/headers: Simplify and clean up header usage in the scheduler Mar 4, 2018
debug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017
hotplug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017
idle.h License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017
init.h License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017
isolation.h sched/isolation: Isolate workqueues when "nohz_full=" is set Feb 21, 2018
jobctl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017
loadavg.h License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017
mm.h fs: fsnotify: account fsnotify metadata to kmemcg Aug 17, 2018
nohz.h sched/nohz: Clean up nohz enter/exit Mar 9, 2018
numa_balancing.h License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017
prio.h License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017
rt.h Merge branch 'linus' into sched/core, to pick up fixes Nov 8, 2017
signal.h Merge branch 'akpm' (patches from Andrew) Aug 22, 2018
stat.h License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017
sysctl.h kernel/hung_task.c: allow to set checking interval separately from ti… Aug 22, 2018
task.h alpha: fix osf_wait4() breakage Jul 22, 2018
task_stack.h sched/headers: Constify object_is_on_stack() Dec 6, 2017
topology.h sched/topology: Add SD_ASYM_CPUCAPACITY flag detection Sep 10, 2018
user.h userns: use refcount_t for reference counting instead atomic_t Aug 22, 2018
wake_q.h License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017
xacct.h License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017