diff options
author | Arve Hjønnevåg <arve@android.com> | 2009-05-29 16:46:13 -0700 |
---|---|---|
committer | Arve Hjønnevåg <arve@android.com> | 2009-05-29 16:46:13 -0700 |
commit | e9bea0a848660db1660416ac872608f6b325481c (patch) | |
tree | b0da352971ff9a62bf3e5ab4e36ec5dd91b15914 /kernel | |
parent | 2bda29ae9ba43a012a4ea9089dc3362b96f167a8 (diff) |
nohz: Fix ondemand governor not always ramping up on 100% load.
On systems that perform the context switch with interrupts enabled
(e.g. ARM) get_cpu_idle_time_us could get stuck returning the last
idle time when the cpu is busy. If an interrupt occurs while
switching to the idle thread, and this interrupt wakes up a thread,
need-resched will be set on the idle thread, but since we have not
finished switching to the idle thread tick_nohz_stop_sched_tick will
be called. (idle_cpu is true since the head of the runqueue is the
idle thread, but need_resched returns false since we are still
running in the context of the old thread)
Fix this by not calling tick_nohz_start_idle when returning from an
interrupt while the idle thread is in its schedule phase.
(!ts->inidle)
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/time/tick-sched.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index d3f1ef4d5cbe..4012da672821 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -222,7 +222,6 @@ void tick_nohz_stop_sched_tick(int inidle) cpu = smp_processor_id(); ts = &per_cpu(tick_cpu_sched, cpu); - now = tick_nohz_start_idle(ts); /* * If this cpu is offline and it is the one which updates @@ -242,6 +241,7 @@ void tick_nohz_stop_sched_tick(int inidle) if (!inidle && !ts->inidle) goto end; + now = tick_nohz_start_idle(ts); ts->inidle = 1; if (need_resched()) |