Skip to content

Commit

Permalink
NOHZ: Properly feed cpufreq ondemand governor
Browse files Browse the repository at this point in the history
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>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Eero Nurkkala authored and Thomas Gleixner committed May 27, 2009
1 parent cd86a53 commit f2e21c9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions kernel/time/tick-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*
Expand All @@ -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())
Expand Down

0 comments on commit f2e21c9

Please sign in to comment.