linux-bl808/kernel/sched
Valentin Schneider 4aed8aa415 sched/fair: Introduce a CPU capacity comparison helper
During load-balance, groups classified as group_misfit_task are filtered
out if they do not pass

  group_smaller_max_cpu_capacity(<candidate group>, <local group>);

which itself employs fits_capacity() to compare the sgc->max_capacity of
both groups.

Due to the underlying margin, fits_capacity(X, 1024) will return false for
any X > 819. Tough luck, the capacity_orig's on e.g. the Pixel 4 are
{261, 871, 1024}. If a CPU-bound task ends up on one of those "medium"
CPUs, misfit migration will never intentionally upmigrate it to a CPU of
higher capacity due to the aforementioned margin.

One may argue the 20% margin of fits_capacity() is excessive in the advent
of counter-enhanced load tracking (APERF/MPERF, AMUs), but one point here
is that fits_capacity() is meant to compare a utilization value to a
capacity value, whereas here it is being used to compare two capacity
values. As CPU capacity and task utilization have different dynamics, a
sensible approach here would be to add a new helper dedicated to comparing
CPU capacities.

Also note that comparing capacity extrema of local and source sched_group's
doesn't make much sense when at the day of the day the imbalance will be
pulled by a known env->dst_cpu, whose capacity can be anywhere within the
local group's capacity extrema.

While at it, replace group_smaller_{min, max}_cpu_capacity() with
comparisons of the source group's min/max capacity and the destination
CPU's capacity.

Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Reviewed-by: Qais Yousef <qais.yousef@arm.com>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Tested-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
Link: https://lkml.kernel.org/r/20210407220628.3798191-4-valentin.schneider@arm.com
2021-04-09 18:02:21 +02:00
..
autogroup.c
autogroup.h
clock.c sched: Fix various typos 2021-03-22 00:11:52 +01:00
completion.c
core.c sched/core: Use -EINVAL in sched_dynamic_mode() 2021-03-25 11:39:13 +01:00
cpuacct.c sched: Fix various typos 2021-03-22 00:11:52 +01:00
cpudeadline.c
cpudeadline.h
cpufreq.c
cpufreq_schedutil.c sched: Fix various typos 2021-03-22 00:11:52 +01:00
cpupri.c sched: Fix various typos 2021-03-22 00:11:52 +01:00
cpupri.h
cputime.c sched: Fix various typos 2021-03-22 00:11:52 +01:00
deadline.c sched: Fix various typos 2021-03-22 00:11:52 +01:00
debug.c sched: Fix various typos 2021-03-22 00:11:52 +01:00
fair.c sched/fair: Introduce a CPU capacity comparison helper 2021-04-09 18:02:21 +02:00
features.h sched: Fix various typos 2021-03-22 00:11:52 +01:00
idle.c sched: Fix various typos 2021-03-22 00:11:52 +01:00
isolation.c
loadavg.c sched: Fix various typos 2021-03-22 00:11:52 +01:00
Makefile
membarrier.c sched/membarrier: fix missing local execution of ipi_sync_rq_state() 2021-03-06 12:40:21 +01:00
pelt.c sched: Fix various typos 2021-03-22 00:11:52 +01:00
pelt.h sched: Fix various typos 2021-03-22 00:11:52 +01:00
psi.c psi: allow unprivileged users with CAP_SYS_RESOURCE to write psi files 2021-04-08 23:09:44 +02:00
rt.c sched: Fix various typos 2021-03-22 00:11:52 +01:00
sched-pelt.h
sched.h sched: Fix various typos 2021-03-22 00:11:52 +01:00
smp.h
stats.c sched: Fix various typos 2021-03-22 00:11:52 +01:00
stats.h psi: Optimize task switch inside shared cgroups 2021-03-06 12:40:23 +01:00
stop_task.c
swait.c
topology.c sched/topology: Remove redundant cpumask_and() in init_overlap_sched_group() 2021-03-25 11:41:23 +01:00
wait.c
wait_bit.c