The effect of nice value in CFS scheduler

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Fri Mar 21 12:21:53 EDT 2014


On Fri, 21 Mar 2014 20:48:22 +0700, Anh Le said:

> I'm studying the CFS scheduler. I'm using ubuntu 13.10 and I assume that
> it's using CFS in it kernel.
>
> I try to see the effect of nice value by running 2 instances of the same
> program (just a while loop of calculations), putting them on the same CPU
> and setting different nice values to them (one is 19 and one is -20). I
> include in the program some printf to see how much it has executed.
>
> According to my understanding, the process with the small nice value should
> get more processor time than the one with the big value. However they seem
> to be on par with each other (they execute approximately the same number of
> loops in the same duration), so I'm really confused.

If you have 2 cores and 2 CPU-bound processes, one process will park on each
core and get close to 100% of the cycles.

Try it with 2 instances per core/hyperthread available.  Look in /proc/cpuinfo
to find how many you need.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140321/b1f25ae8/attachment.bin 


More information about the Kernelnewbies mailing list