How cpu entitlement is calculated/enforce for cpu subgroup?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I understand that CPU entitlement is based on cpu.share. If all the groups
are defined at first level, that is simple.
Once subgroups are defined, cgroups behave differently.
If you define cgroups hierarchy, then CPU entitlement is enforced base on
the cpu.share of "each" group and subgroup.
For example:
* group A has 1024 cpu.share
   Group A has two subgroup: A1, A2. Each has 1024 cpu.share
* group B has 1024 cpu.share
If you run process(es) in group, A, A1, A2, and, B. Each group and subgroups
get 25% of all the CPU.

Below is an example on defining cgroup hierarchy
Cpu = /cgroups/hierarchy
Cpuacct = /cgroup/hierarch
Memory = /cgroup/hierarch

If you do not define cgroup hierarchy, then cgroup treat A/A1/A2 as one
group and will get 50% CPU, and B will get 50% as well.
I can understand the reason why it is implemented this way. But, I don't
understand how cgroup divide that 50%  between A, A1, and A2.
During my testing, I found A1 and A2 received 10%, while the processes in
group A received about 30% CPU. All together, processes in A/A1/A2 received
about 50% CPU.

What is the formulate for this scenario? Is there a document for this.

John


--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux