From: Joseph H Allen (jhallen@world.std.com)
Date: 02/10/93


From: jhallen@world.std.com (Joseph H Allen)
Subject: Re: linux OS
Date: Wed, 10 Feb 1993 12:01:57 GMT

In article <1993Feb10.102925.10234@klaava.Helsinki.FI> torvalds@klaava.Helsinki.FI (Linus Torvalds) writes:
>In article <C27EEK.HtM@dutiws.twi.tudelft.nl> bloois@dutiws.twi.tudelft.nl (R.M.de Bloois.TI-OSGS-tel-01819-12030) writes:
>>1. The priority in Linux is not dynamically adapted based on
>> past execution, at all.

>Actually, it is: the algorithm is very simple and may not look
>altogether obvious, but it works well for most cases. The current linux
>scheduling is roughly:
>
> - a wakeup() of a process with a higher 'counter' (== priority + aging)
> than the currently running processes' will result in a reschedule
> (although not necessarily at once). This means that interactive and
> other IO processes usually get good response.

Yeah, this has some interesting results. Processes which have been waiting
for a long time get a really high priority level, especially when only a few
processes are running (when you don't need the priority changing so much).
If a lot of processes are running, the time it takes for all the counters to
zero is long, so the aging doesn't get added in (and big priority change
would be nice when there are lots of processes).

It seems to work well in practice though. I think because linux is really
used as single user os, and complex things like pipelines are effected
pretty evenly.

-- 
/*  jhallen@world.std.com (192.74.137.5) */               /* Joseph H. Allen */
int a[1817];main(z,p,q,r){for(p=80;q+p-80;p-=2*a[p])for(z=9;z--;)q=3&(r=time(0)
+r*57)/7,q=q?q-1?q-2?1-p%79?-1:0:p%79-77?1:0:p<1659?79:0:p>158?-79:0,q?!a[p+q*2
]?a[p+=a[p+=q]=q]=q:0:0;for(;q++-1817;)printf(q%79?"%c":"%c\n"," #"[!a[q-1]]);}