All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NOHZ: Properly feed cpufreq ondemand governor
@ 2009-05-25  6:57 ext-eero.nurkkala
  2009-05-26 15:17 ` Rik van Riel
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: ext-eero.nurkkala @ 2009-05-25  6:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: tglx, Eero Nurkkala

From: Eero Nurkkala <ext-eero.nurkkala@nokia.com>

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@nokia.com>
Reported-by: Tero Kristo <tero.kristo@nokia.com>
---
 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..a3562ce 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)
+		goto end;
+
 	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())
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-05-27 13:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-25  6:57 [PATCH] NOHZ: Properly feed cpufreq ondemand governor ext-eero.nurkkala
2009-05-26 15:17 ` Rik van Riel
2009-05-26 17:47   ` Pallipadi, Venkatesh
2009-05-27 11:57 ` [tip:timers/urgent] " tip-bot for Eero Nurkkala
2009-05-27 12:18   ` Eero Nurkkala
2009-05-27 12:49     ` Thomas Gleixner
2009-05-27 12:54 ` tip-bot for Eero Nurkkala
2009-05-27 13:23   ` Rik van Riel
2009-05-27 13:33     ` Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.