cpufreq: Max freq invariant scheduler load-tracking and cpu capacity support
authorDietmar Eggemann <dietmar.eggemann@arm.com>
Tue, 22 Sep 2015 15:47:48 +0000 (16:47 +0100)
committerPunit Agrawal <punit.agrawal@arm.com>
Mon, 21 Mar 2016 12:34:30 +0000 (12:34 +0000)
commit25fd93de74994e4bdcec2ec4ed0814207a8e0e4b
treee4844acbf0f2d0001fa454e1382bd06b579dd3a7
parentf903bd14ff9d8d0ef499f3fff6cb93f72932e4d9
cpufreq: Max freq invariant scheduler load-tracking and cpu capacity support

Implements cpufreq_scale_max_freq_capacity() to provide the scheduler
with a maximum frequency scaling correction factor for more accurate
load-tracking and cpu capacity handling by being able to deal with
frequency capping.

This scaling factor describes the influence of running a cpu with a
current maximum frequency lower than the absolute possible maximum
frequency on load tracking and cpu capacity.

The factor is:

current_max_freq(cpu) << SCHED_CAPACITY_SHIFT / max_freq(cpu)

In fact, max_freq_scale should be a struct cpufreq_policy data member.
But this would require that the scheduler hot path (__update_load_avg())
would have to grab the cpufreq lock. This can be avoided by using per-cpu
data initialized to SCHED_CAPACITY_SCALE for max_freq_scale.

Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
drivers/cpufreq/cpufreq.c
include/linux/cpufreq.h