Commit 94862a62 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Revert "cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC"

Revert commit 0df35026 (cpufreq: governor: Fix negative idle_time
when configured with CONFIG_HZ_PERIODIC) that introduced a regression
by causing the ondemand cpufreq governor to misbehave for
CONFIG_TICK_CPU_ACCOUNTING unset (the frequency goes up to the max at
one point and stays there indefinitely).

The revert takes subsequent modifications of the code in question into
account.

Fixes: 0df35026 (cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC)
Link: https://bugzilla.kernel.org/show_bug.cgi?id=115261Reported-and-tested-by: default avatarTimo Valtoaho <timo.valtoaho@gmail.com>
Cc: 4.5+ <stable@vger.kernel.org> # 4.5+
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent c9d9c929
...@@ -193,12 +193,8 @@ unsigned int dbs_update(struct cpufreq_policy *policy) ...@@ -193,12 +193,8 @@ unsigned int dbs_update(struct cpufreq_policy *policy)
wall_time = cur_wall_time - j_cdbs->prev_cpu_wall; wall_time = cur_wall_time - j_cdbs->prev_cpu_wall;
j_cdbs->prev_cpu_wall = cur_wall_time; j_cdbs->prev_cpu_wall = cur_wall_time;
if (cur_idle_time <= j_cdbs->prev_cpu_idle) { idle_time = cur_idle_time - j_cdbs->prev_cpu_idle;
idle_time = 0; j_cdbs->prev_cpu_idle = cur_idle_time;
} else {
idle_time = cur_idle_time - j_cdbs->prev_cpu_idle;
j_cdbs->prev_cpu_idle = cur_idle_time;
}
if (ignore_nice) { if (ignore_nice) {
u64 cur_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE]; u64 cur_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE];
......
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