I was wondering how cgroup cpu shares/weights (v1: cpu.shares or v2: cpu.weight) and the niceness value of a task do interact in Linux with the CFS (Completely Fair Scheduler). Both values have an influence on the weighting of process relative to other processes.

The questions is: What happens if you mix the two concepts?

  1. Are the two weights multiplied/mixed?
  2. Are cgroup shares respected in the first order and the niceness values only applied to resource conflicts in the same cgroup?
  3. Some other model I cannot imagine.

Example: If I have a single process in a cgroup and all other processes in another cgroup. Both cgroups have cpu.shares/weight set to an arbitrary value. Does the nice value of the single process influence the absolute weight of the single cgroup process relative to the other processes?

  • 1
    I wish I could find the reference link but I cannot. I had the same confusion as you had when I looked at cgroup v1. What I found out was that when you "nice" something, the nice value was being converted into cpu.shares accordingly. – Umut Sep 28 '18 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.