Re: Time slices on linux


Subject: Re: Time slices on linux
From: Justin Vallon (vallon@mindspring.com)
Date: Tue Sep 05 2000 - 19:53:07 MDT


At 4:23 PM +0200 9/3/00, Christian Jaeger wrote:
>Hello
>
>The following shows the problem:
>Give mol a lower priority (to make the problem appear stronger). Run a
>process using the CPU constantly, i.e. "perl -e 'while(1){}'", then switch
>to mol. When moving the mouse, the pointer stands still every half second
>or so.
>(I give mol a lower priority because I have some Mac applications running
>that are not releasing cpu correctly when idle.)
>
>>From this I would conclude that linux only switches (time-slices) between
>processes only every 0.2 seconds or so, but that seems very slow. If this
>is really the case, can one configure linux to switch faster to get a more
>smooth result?

It sounds like the kernel is doing exactly what you asked for. You
have given the CPU-intensive perl-script a higher priority than MOL
(also pretty CPU-intensitve if it is just spinning cycles).

In reality, I believe it switches every 60th or 100th of a second.
It may (probably) be deciding that your lower-priority process should
not be getting any CPU time, because it has a lower-priority.

The scheduler decides when to run a given process. You can try an
experiment with two CPU-hog perl scripts, running at different nice
levels. Check the ratio of CPU time between the two levels (ie: 10
sec to 1 sec) to get an indication of how much weighting the
scheduler gives to the two priority levels that you are using.

-- 
-Justin
vallon@mindspring.com



This archive was generated by hypermail 2a24 : Tue Sep 05 2000 - 20:03:39 MDT