From: Eero Nurkkala Date: Mon, 25 May 2009 06:57:37 +0000 (+0300) Subject: NOHZ: Properly feed cpufreq ondemand governor X-Git-Tag: v2.6.31-rc1~96^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f2e21c9610991e95621a81407cdbab881226419b;p=platform%2Fkernel%2Flinux-3.10.git 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 Reported-by: Tero Kristo Acked-by: Rik van Riel Acked-by: Venkatesh Pallipadi Signed-off-by: Thomas Gleixner --- 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())