Execution lags

Stefan Bader stefan.bader at canonical.com
Sat Mar 13 15:28:57 UTC 2010


Ancoron Luciferis wrote:
> Hi *,
> 
> I really don't want to disturb your hard work but I've got a problem 
> that I'm unable to find a reason for.
> 
> I'm currently running Kubuntu Lucid with latest updates on an AMD Phenom 
> II X4 machine. The problem is, that execution of anything lags sometimes 
> until I press some key or move the mouse.
> 
> For this to messure I used a simple command line:
> 
> while [ 0 ]; do oldtime=$time; time=`date +'%s.%N'`; echo "($time - 
> $oldtime - 1) * 1000" | bc -l | xargs printf "[$time] missed %1.0f 
> ms\n"; sleep 1; done | tee ticks.log
> 
> 
> The output of that looks like this:
> 
> [1268440070.490933942] missed 1268440071491 ms
> [1268440071.562506937] missed 72 ms
> [1268440072.580239127] missed 18 ms
> [1268440073.597819427] missed 18 ms
> [1268440074.615416926] missed 18 ms
> [1268440075.633107479] missed 18 ms
> [1268440077.765155286] missed 1132 ms
> [1268440078.778187875] missed 13 ms
> [1268440079.792391115] missed 14 ms
> [1268440080.806246041] missed 14 ms
> [1268440081.818535399] missed 12 ms
> [1268440082.834927532] missed 16 ms
> [1268440083.849656171] missed 15 ms
> [1268440084.865000558] missed 15 ms
> [1268440085.882215112] missed 17 ms
> [1268440086.898824440] missed 17 ms
> [1268440087.917051832] missed 18 ms
> [1268440088.933482288] missed 16 ms
> [1268440089.949114926] missed 16 ms
> [1268440090.966478632] missed 17 ms
> [1268440091.983695874] missed 17 ms
> [1268440093.000970062] missed 17 ms
> [1268440094.017714305] missed 17 ms
> [1268440111.553100689] missed 16535 ms
> [1268440112.565352587] missed 12 ms
> [1268440113.585565660] missed 20 ms
> [1268440114.598418830] missed 13 ms
> [1268440115.615446402] missed 17 ms
> 
> When I ran that command nothing CPU intensive was running so the 
> differences should be within a few milleseconds but as you can see 
> sometimes they are not. During those longer "pauses" I can press a key 
> to stop the pause and to continue running.
> 
> These lags affect all processes, ot only the command line. The whole 
> screen freezes during that "pause" time and this even happens e.g. when 
> running some package update or even at shutdown.
> 
> I carefully checked all the logs available on my system to get some kind 
> of hint but without success.
> 
> I let that command run over night to see how big those lags go usually 
> during idle time and this is what I got (top ten):
> 
> $ sed '1,1d' ticks.log | awk '{print $3 " ms " $1}' | sort -rn | head 
> -10 | awk '{print $3 " missed " $1 " ms"}'
> [1268441221.483105541] missed 58989 ms
> [1268442781.361738141] missed 56980 ms
> [1268452136.116237759] missed 54297 ms
> [1268457480.726283135] missed 51632 ms
> [1268468280.295310837] missed 50872 ms
> [1268442301.336665143] missed 49843 ms
> [1268476556.072677119] missed 49462 ms
> [1268460301.451315487] missed 48832 ms
> [1268457288.692267086] missed 47441 ms
> [1268477333.834187845] missed 47371 ms
> 
> So up to one minute the system freezes without actually freezing. When 
> there is some CPU usage like watching a HD video or doing some 3D 
> rendering inside a VM those lags don't occur.
> 
> Please help me here sorting out the core reason for this. I don't know 
> where to start looking.
> 
> Ancoron.
> 
> 
I would check whether the number of timer interrupts on your system increments.
You can see this with 'watch cat /proc/interrupts" (its IRQ0).
If that number does not increase quite often, you might try to boot with
"acpi_skip_timer_override" on the grub/kernel commandline.

Stefan




More information about the kernel-team mailing list