* timer.c - high load avarage with idle cpu
@ 2010-12-01 14:37 Harry Nak
2010-12-01 15:54 ` Damien Wyart
0 siblings, 1 reply; 3+ messages in thread
From: Harry Nak @ 2010-12-01 14:37 UTC (permalink / raw)
To: linux-kernel
Hi all,
I am developing an application on a at91rm9200 platform. Recently I
found out that the load average on this system is very high while the
cpu remains almost idle.
My application uses a lot of timers but the expiration of such a timer
causes almost no processing to be performed.
I think I found the reason for this load average/cpu usage
inconsistency and I (think I ) found a solution:
update_process_times() in timer.c first calls the function
run_local_timers() before calling scheduler_tick().
run_local_timers() raises TIMER_SOFTIRQ, which causes threads
associated with any expired timers to be marked RUNNABLE.
scheduler_tick() -> update_cpu_load() -> calc_load_account_active() ->
calc_load_fold_active() adds such a thread to the number of active
threads, thus causing the load average to increase. However this
particular thread never had to wait to become running and it will not
consume much cpu time.
My solution is to postpone the call to run_local_timers() until
scheduler_tick() has been called.
Could anybody confirm my theory and is it possible that my solution
breaks anything?
- Harry
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: timer.c - high load avarage with idle cpu
2010-12-01 14:37 timer.c - high load avarage with idle cpu Harry Nak
@ 2010-12-01 15:54 ` Damien Wyart
2010-12-02 10:00 ` Harry Nak
0 siblings, 1 reply; 3+ messages in thread
From: Damien Wyart @ 2010-12-01 15:54 UTC (permalink / raw)
To: Harry Nak; +Cc: linux-kernel, Peter Zijlstra
Hi,
> [...]
> My solution is to postpone the call to run_local_timers() until
> scheduler_tick() has been called.
> Could anybody confirm my theory and is it possible that my solution
> breaks anything?
Your problem might be related to this thread:
https://lkml.org/lkml/2010/9/29/51
--
Damien
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: timer.c - high load avarage with idle cpu
2010-12-01 15:54 ` Damien Wyart
@ 2010-12-02 10:00 ` Harry Nak
0 siblings, 0 replies; 3+ messages in thread
From: Harry Nak @ 2010-12-02 10:00 UTC (permalink / raw)
To: linux-kernel
Damien Wyart <damien.wyart@free.fr> wrote:
>> [...]
>> My solution is to postpone the call to run_local_timers() until
>> scheduler_tick() has been called.
>
>> Could anybody confirm my theory and is it possible that my solution
>> breaks anything?
>
> Your problem might be related to this thread:
> https://lkml.org/lkml/2010/9/29/51
Thanks for the hint. However from what I have read in this thread,
this deals specifically with a tickless kernel, while my issue
manifests on a regular HZ kernel.
- Harry
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-12-02 10:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-01 14:37 timer.c - high load avarage with idle cpu Harry Nak
2010-12-01 15:54 ` Damien Wyart
2010-12-02 10:00 ` Harry Nak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).