fix cpufreq-ondemand by accounting skipped ticks as idle ticks [Was: [PATCH] i386 no idle HZ aka Dynticks 051203]

From: Dominik Brodowski
Date: Sun Dec 04 2005 - 07:33:53 EST


Account ticks skipped dynamically as idle ticks.

This allows the ondemand cpufreq governor to work correctly with dyntick.

Signed-off-by: Dominik Brodowski <linux@xxxxxxxxxxxxxxxxxxxx>

Index: working-tree/arch/i386/kernel/dyn-tick.c
===================================================================
--- working-tree.orig/arch/i386/kernel/dyn-tick.c
+++ working-tree/arch/i386/kernel/dyn-tick.c
@@ -19,6 +19,7 @@
#include <linux/dyn-tick.h>
#include <linux/timer.h>
#include <linux/irq.h>
+#include <linux/kernel_stat.h>
#include <asm/apic.h>
#include <asm/dyn-tick.h>

@@ -109,6 +110,8 @@ void dyn_tick_interrupt(struct pt_regs *
do_timer(regs);
if (cpu_has_local_apic())
enable_pit_timer();
+ if (lost)
+ kstat_cpu(cpu).cpustat.idle += (lost - 1);
}
cpu_clear(cpu, nohz_cpu_mask);
spin_unlock(&dyn_tick->lock);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/