Skip to content

Commit

Permalink
uml: an idle system should have zero load average
Browse files Browse the repository at this point in the history
The ever-vigilant users of linode.com noticed that an idle 2.6 UML has a
persistent load average of ~.4.

It turns out that because the UML timer handler processed softirqs before
actually delivering the tick, the tick was counted in the context of the idle
thread about half the time.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed May 8, 2007
1 parent f1adc05 commit c83e448
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/um/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ int do_settimeofday(struct timespec *tv)

void timer_handler(int sig, union uml_pt_regs *regs)
{
if(current_thread->cpu == 0)
timer_irq(regs);
local_irq_disable();
irq_enter();
update_process_times(CHOOSE_MODE(
(UPT_SC(regs) && user_context(UPT_SP(regs))),
(regs)->skas.is_user));
irq_exit();
local_irq_enable();
if(current_thread->cpu == 0)
timer_irq(regs);
}

0 comments on commit c83e448

Please sign in to comment.