Commit 7af1c056 authored by Stratos Karafotis's avatar Stratos Karafotis Committed by Rafael J. Wysocki

cpufreq: conservative: Fix sampling_down_factor functionality

sampling_down_factor tunable is unused since commit
8e677ce8 (4 years ago).

This patch restores the original functionality and documents the
tunable.
Signed-off-by: default avatarStratos Karafotis <stratosk@semaphore.gr>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 9366d840
...@@ -191,6 +191,12 @@ governor but for the opposite direction. For example when set to its ...@@ -191,6 +191,12 @@ governor but for the opposite direction. For example when set to its
default value of '20' it means that if the CPU usage needs to be below default value of '20' it means that if the CPU usage needs to be below
20% between samples to have the frequency decreased. 20% between samples to have the frequency decreased.
sampling_down_factor: similar functionality as in "ondemand" governor.
But in "conservative", it controls the rate at which the kernel makes
a decision on when to decrease the frequency while running in any
speed. Load for frequency increase is still evaluated every
sampling rate.
3. The Governor Interface in the CPUfreq Core 3. The Governor Interface in the CPUfreq Core
============================================= =============================================
......
...@@ -36,9 +36,9 @@ static DEFINE_PER_CPU(struct cs_cpu_dbs_info_s, cs_cpu_dbs_info); ...@@ -36,9 +36,9 @@ static DEFINE_PER_CPU(struct cs_cpu_dbs_info_s, cs_cpu_dbs_info);
/* /*
* Every sampling_rate, we check, if current idle time is less than 20% * Every sampling_rate, we check, if current idle time is less than 20%
* (default), then we try to increase frequency Every sampling_rate * * (default), then we try to increase frequency. Every sampling_rate *
* sampling_down_factor, we check, if current idle time is more than 80%, then * sampling_down_factor, we check, if current idle time is more than 80%
* we try to decrease frequency * (default), then we try to decrease frequency
* *
* Any frequency increase takes it to the maximum frequency. Frequency reduction * Any frequency increase takes it to the maximum frequency. Frequency reduction
* happens at minimum steps of 5% (default) of maximum frequency * happens at minimum steps of 5% (default) of maximum frequency
...@@ -81,6 +81,11 @@ static void cs_check_cpu(int cpu, unsigned int load) ...@@ -81,6 +81,11 @@ static void cs_check_cpu(int cpu, unsigned int load)
return; return;
} }
/* if sampling_down_factor is active break out early */
if (++dbs_info->down_skip < cs_tuners->sampling_down_factor)
return;
dbs_info->down_skip = 0;
/* /*
* The optimal frequency is the frequency that is the lowest that can * The optimal frequency is the frequency that is the lowest that can
* support the current CPU usage without triggering the up policy. To be * support the current CPU usage without triggering the up policy. To be
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment