A question about CFS

A question about CFS

Shachar Shemesh shachar at shemesh.biz
Tue Jun 9 11:05:29 IDT 2009


Hi all,

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):
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.

My questions:

   1. 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?
   2. 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.
   3. 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?

Thanks,
Shachar

-- 
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20090609/a03582ce/attachment.html>


More information about the Linux-il mailing list