<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body dir="ltr" bgcolor="#ffffff" text="#000000">
Hi all,<br>
<br>
I'm trying to understand Linux's Completely Fair Scheduler better, here
is what I got so far (sources - wikipedia, Gilad's slides on tuxology):<br>
Each process is assigned a "wall clock", which is how much CPU wall
time it should get if the system is completely fair. The system also
tracks how much time it spends waiting. The difference between the two
(wall time - waiting time) is the sort key for all the processes in the
system (exact details irrelevant for this discussion). The process with
the biggest difference (i.e. - greatest waiting time) is the next one
to receive the CPU.<br>
<br>
My questions:<br>
<ol>
<li>How do the different priorities factor in? Obviously, the real
time priorities do not (their scheduling methods are well defined), but
how about the nice values? The "fair clock" is a property of "rq" (run
queue) - does that mean that each nice value has its own queue? If so,
how do the relative priorities happen?</li>
<li>Are those "all processes in the system", or just "ready processes
in the system"? Wikipedia says that CFS treats wait time due to "sorry,
no CPU for you" and wait time due to "I don't need the CPU right now"
the same, so this suggests all processes. Then again, if this really is
all processes, the O(log n) must really hurt.</li>
<li>The articles say that CFS gives extra priority for interactive
processes, but does not mention how. Is this just a by product of the
wall time - wait time calculation (makes sense), or is there any
additional tweaking going on that does that?</li>
</ol>
Thanks,<br>
Shachar<br>
<pre class="moz-signature" cols="72">--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
<a class="moz-txt-link-freetext" href="http://www.lingnu.com">http://www.lingnu.com</a>
</pre>
</body>
</html>