Skip to contentSkip to conversation

Correctly calculate load

PATCH New Mark Langsdorf 1 participant 1 message Dec 3, 2007 CPU frequency scaling framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Correctly calculate load

The idle time of the system should be less than the wall time of the system. The initial implementation incorrectly set idle time to wall time when idle time was less than wall time, instead of when idle time was more than wall time. Correct this error.

drivers/cpufreq/cpufreq_ondemand.c +1 -1
diff -r fd879c0688bf drivers/cpufreq/cpufreq_ondemand.c
@@ -319,7 +319,7 @@ static int dbs_calc_load(struct cpu_dbs_
 		tmp_idle_msecs = tmp_idle_nsecs;
 		if (tmp_wall_msecs == 0)
 			tmp_wall_msecs = 1;
-		if (tmp_idle_msecs < tmp_wall_msecs)
+		if (tmp_idle_msecs > tmp_wall_msecs)
 			tmp_idle_msecs = tmp_wall_msecs;
 
 		tmp_load = (100 * (tmp_wall_msecs - tmp_idle_msecs)) /