Why do the CFS chase fairness?

Parmenides mobile.parmenides at gmail.com
Sat Sep 17 14:29:50 EDT 2011


   Current kernel 2.6 have adopted the CFS scheduler which try to
ensure that all process can obtain their proportions of allotted
processor fairly.  I have three questions about it.

   1. How to understand unfairness?

   I think unfairness is caused by processes sharing a processor, but
I am not confident of it.  According to Love, as far as fairness is
concerned, if a processor is a perfectly multitasking processor, all
of processes running on it should run simultaneously rather than run
in turn. For example, there are two processes which have the same nice
value. Both of them may run 10 ms on a perfectly multitasking
processor, each at 50% of processor power. This kind of processor is
prefect fair.

   In contrast, if the two processes run in turn on a real processor,
each may run 5ms at 100% of processor power. Although in both of the
two cases two processes run 10ms totally, but the latter case is
unfair because one process runs first, the other has to wait for 5ms.
In other words, when processes running on a real processor, some of
them has to wait more or less until preceding processes use up their
CPU shares. Does unfairness mean that?

   2. Why do processes need fairness?

   Yes, we can argue that now that we human beings need fairness,
processes do so. :-)  But, are there advantages if the scheduler care
about fairness? Just for processes not waiting too long? Or other

   3. What's the drawbacks of traditional schdulers?

    According to Love, traditional schedulers assign each process a
absolut timeslcie which yields a constant switching rate but variable
fairness. How to understand 'constant switching rate'? What does cause
'variable fairness'?

More information about the Kernelnewbies mailing list