[tip:timers/urgent] NOHZ: Properly feed cpufreq ondemand governor

From: tip-bot for Eero Nurkkala
Date: Wed May 27 2009 - 08:55:17 EST


Commit-ID: cf1240033cc81216a18eec0ca71466f7fe4eeda8
Gitweb: http://git.kernel.org/tip/cf1240033cc81216a18eec0ca71466f7fe4eeda8
Author: Eero Nurkkala <ext-eero.nurkkala@xxxxxxxxx>
AuthorDate: Mon, 25 May 2009 09:57:37 +0300
Committer: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
CommitDate: Wed, 27 May 2009 14:51:47 +0200

NOHZ: Properly feed cpufreq ondemand governor

A call from irq_exit() may occasionally pause the timing
info for cpufreq ondemand governor. This results in the
cpufreq ondemand governor to fail to calculate the
system load properly. Thus, relocate the checks for this
particular case to keep the governor always functional.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@xxxxxxxxx>
Reported-by: Tero Kristo <tero.kristo@xxxxxxxxx>
Acked-by: Rik van Riel <riel@xxxxxxxxxx>
Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@xxxxxxxxx>
LKML-Reference: <12432346571351-git-send-email-ext-eero.nurkkala@xxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>


---
kernel/time/tick-sched.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index d3f1ef4..233b4e7 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -222,6 +222,15 @@ void tick_nohz_stop_sched_tick(int inidle)

cpu = smp_processor_id();
ts = &per_cpu(tick_cpu_sched, cpu);
+
+ /*
+ * Call to tick_nohz_start_idle stops the last_update_time from being
+ * updated. Thus, it must not be called in the event we are called from
+ * irq_exit() with the prior state different than idle.
+ */
+ if (!inidle && !ts->inidle)
+ return;
+
now = tick_nohz_start_idle(ts);

/*
@@ -239,9 +248,6 @@ void tick_nohz_stop_sched_tick(int inidle)
if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE))
goto end;

- if (!inidle && !ts->inidle)
- goto end;
-
ts->inidle = 1;

if (need_resched())
--
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/