timer.c - high load avarage with idle cpu

Previous thread: [PATCH] rtc: Add missing include to gef_wdt. by Martyn Welch on Wednesday, December 1, 2010 - 7:31 am. (1 message)

Next thread: [PATCH] add regulation of BLK_EH_RESET_TIMER for block request by Hillf Danton on Wednesday, December 1, 2010 - 7:40 am. (1 message)
From: Harry Nak
Date: Wednesday, December 1, 2010 - 7:37 am

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
--

From: Damien Wyart
Date: Wednesday, December 1, 2010 - 8:54 am

Your problem might be related to this thread:
https://lkml.org/lkml/2010/9/29/51

-- 
Damien
--

From: Harry Nak
Date: Thursday, December 2, 2010 - 3:00 am

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
--

Previous thread: [PATCH] rtc: Add missing include to gef_wdt. by Martyn Welch on Wednesday, December 1, 2010 - 7:31 am. (1 message)

Next thread: [PATCH] add regulation of BLK_EH_RESET_TIMER for block request by Hillf Danton on Wednesday, December 1, 2010 - 7:40 am. (1 message)