Skip to contentSkip to conversation

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

PATCH In review Rafael J. Wysocki 2 participants 2 messages Apr 21, 2016 – Apr 22, 2016 CPU frequency scaling framework

lore
Share & tools
lore
#0 lore raw

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

From: Rafael J. Wysocki <[email protected]>

Revert commit 0df35026c6a5 (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 0df35026c6a5 (cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC)
Reported-and-tested-by Timo Valtoaho <[email protected]>
Cc 4.5+ <[email protected]> # 4.5+
---
 drivers/cpufreq/cpufreq_governor.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/cpufreq/cpufreq_governor.c +2 -6
Index: linux-pm/drivers/cpufreq/cpufreq_governor.c
===================================================================
@@ -146,12 +146,8 @@ unsigned int dbs_update(struct cpufreq_p
 		wall_time = cur_wall_time - j_cdbs->prev_cpu_wall;
 		j_cdbs->prev_cpu_wall = cur_wall_time;
 
-		if (cur_idle_time <= j_cdbs->prev_cpu_idle) {
-			idle_time = 0;
-		} else {
-			idle_time = cur_idle_time - j_cdbs->prev_cpu_idle;
-			j_cdbs->prev_cpu_idle = cur_idle_time;
-		}
+		idle_time = cur_idle_time - j_cdbs->prev_cpu_idle;
+		j_cdbs->prev_cpu_idle = cur_idle_time;
 
 		if (ignore_nice) {
 			u64 cur_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE];
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 29 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

Revert commit 0df35026c6a5 (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 0df35026c6a5 (cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC)
Reported-and-tested-by Timo Valtoaho <[email protected]>
Cc 4.5+ <[email protected]> # 4.5+
---
 drivers/cpufreq/cpufreq_governor.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Index: linux-pm/drivers/cpufreq/cpufreq_governor.c
===================================================================

drivers/cpufreq/cpufreq_governor.c +0 -1
@@ -146,12 +146,8 @@ unsigned int dbs_update(struct cpufreq_p
 		wall_time = cur_wall_time - j_cdbs->prev_cpu_wall;
 		j_cdbs->prev_cpu_wall = cur_wall_time;
 
-		if (cur_idle_time <= j_cdbs->prev_cpu_idle) {

drivers/cpufreq/cpufreq_governor.c unsigned int dbs_update(struct cpufreq_p · line 153

Quoted 10 lines
drivers/cpufreq/cpufreq_governor.c +2 -5
-			idle_time = 0;
-		} else {
-			idle_time = cur_idle_time - j_cdbs->prev_cpu_idle;
-			j_cdbs->prev_cpu_idle = cur_idle_time;
-		}
+		idle_time = cur_idle_time - j_cdbs->prev_cpu_idle;
+		j_cdbs->prev_cpu_idle = cur_idle_time;
 
 		if (ignore_nice) {
 			u64 cur_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE];
Signature · 1 line
viresh