Skip to content

Commit 94862a6

Browse files
committed
Revert "cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC"
Revert commit 0df3502 (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: 0df3502 (cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC) Link: https://bugzilla.kernel.org/show_bug.cgi?id=115261 Reported-and-tested-by: Timo Valtoaho <timo.valtoaho@gmail.com> Cc: 4.5+ <stable@vger.kernel.org> # 4.5+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent c9d9c92 commit 94862a6

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/cpufreq/cpufreq_governor.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,8 @@ unsigned int dbs_update(struct cpufreq_policy *policy)
193193
wall_time = cur_wall_time - j_cdbs->prev_cpu_wall;
194194
j_cdbs->prev_cpu_wall = cur_wall_time;
195195

196-
if (cur_idle_time <= j_cdbs->prev_cpu_idle) {
197-
idle_time = 0;
198-
} else {
199-
idle_time = cur_idle_time - j_cdbs->prev_cpu_idle;
200-
j_cdbs->prev_cpu_idle = cur_idle_time;
201-
}
196+
idle_time = cur_idle_time - j_cdbs->prev_cpu_idle;
197+
j_cdbs->prev_cpu_idle = cur_idle_time;
202198

203199
if (ignore_nice) {
204200
u64 cur_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE];

0 commit comments

Comments
 (0)