Re: 2.6.20-rc6-mm2

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Karsten Wiese
Date: Monday, January 29, 2007 - 9:22 am

Hi,

with dynticks and highres_timers enabled, cpufreq_ondemand makes mess here on
an AMD64 UP.
cpufreq_ondemand assumes that jiffies advance at exactly the same pace as the
sum of all kstat_cpu(cpu).cpustat.* members.
This isn't the case here as dmesg output from patch below shows.

Is cpufreq_ondemand correct assuming
 "jiffies advance at exactly the same pace as the
  sum of all kstat_cpu(cpu).cpustat.* members"?
Or is "dynticks and highres_timers"'s behaviour of incrementing the
sum of  kstat_cpu(cpu).cpustat.* members faster than jiffies?

      Karsten



diff -pur rc6-mm2/drivers/cpufreq/cpufreq_ondemand.c rc6-mm2-kw/drivers/cpufreq/cpufreq_ondemand.c
--- rc6-mm2/drivers/cpufreq/cpufreq_ondemand.c	2007-01-29 10:40:39.000000000 +0100
+++ rc6-mm2-kw/drivers/cpufreq/cpufreq_ondemand.c	2007-01-29 11:37:08.000000000 +0100
@@ -370,7 +370,15 @@ static void dbs_check_cpu(struct cpu_dbs
 		if (tmp_idle_ticks < idle_ticks)
 			idle_ticks = tmp_idle_ticks;
 	}
-	load = (100 * (total_ticks - idle_ticks)) / total_ticks;
+	if (total_ticks < idle_ticks) {
+		static bool did;
+		if (!did) {
+			printk(KERN_INFO"%s: t%u < i%u\n", __FUNCTION__, total_ticks, idle_ticks);
+			did = true;
+		}
+		load = 0;
+	} else
+		load = (100 * (total_ticks - idle_ticks)) / total_ticks;
 
 	/* Check for frequency increase */
 	if (load > dbs_tuners_ins.up_threshold) {
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.20-rc6-mm2, Andrew Morton, (Mon Jan 29, 1:12 am)
Re: 2.6.20-rc6-mm2, Jiri Kosina, (Mon Jan 29, 4:02 am)
[-mm patch] BUG at net/sunrpc/svc.c:128 (was Re: 2.6.20-rc ..., Frederik Deweerdt, (Mon Jan 29, 4:21 am)
Re: 2.6.20-rc6-mm2, Thomas Gleixner, (Mon Jan 29, 8:40 am)
Re: 2.6.20-rc6-mm2, Karsten Wiese, (Mon Jan 29, 9:22 am)
Re: 2.6.20-rc6-mm2, Jiri Kosina, (Mon Jan 29, 9:28 am)
Re: 2.6.20-rc6-mm2, Thomas Gleixner, (Mon Jan 29, 9:38 am)
Re: 2.6.20-rc6-mm2 - modules_install error, Matthew Frost, (Mon Jan 29, 10:28 am)
Re: [-mm patch] BUG at net/sunrpc/svc.c:128 (was Re: 2.6.2 ..., Christoph Lameter, (Mon Jan 29, 10:49 am)
Re: 2.6.20-rc6-mm2, Laurent Riffard, (Mon Jan 29, 2:37 pm)
[PATCH] compile and link utsname_sysctl.o, Laurent Riffard, (Mon Jan 29, 2:59 pm)
Re: 2.6.20-rc6-mm2, Maciej Rutecki, (Tue Jan 30, 3:27 am)
Re: [-mm patch] BUG at net/sunrpc/svc.c:128 (was Re: 2.6.2 ..., Frederik Deweerdt, (Tue Jan 30, 7:17 am)
Re: [PATCH] compile and link utsname_sysctl.o, Eric W. Biederman, (Tue Jan 30, 8:11 am)
Re: [PATCH] compile and link utsname_sysctl.o, Laurent Riffard, (Tue Jan 30, 9:26 am)