public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
* How cpu entitlement is calculated/enforce for cpu subgroup?
@ 2014-09-15  0:51 John Wei
  2014-09-15  2:46 ` james
  0 siblings, 1 reply; 3+ messages in thread
From: John Wei @ 2014-09-15  0:51 UTC (permalink / raw)
  To: 'LKML-cgroups'

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-15  4:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-15  0:51 How cpu entitlement is calculated/enforce for cpu subgroup? John Wei
2014-09-15  2:46 ` james
     [not found]   ` <CAKTCnzkVx7_aeTrYKQCBXoSj2w4z-cMSqOEYJRkLVAEGz_bdrA@mail.gmail.com>
     [not found]     ` <CAKTCnzkVx7_aeTrYKQCBXoSj2w4z-cMSqOEYJRkLVAEGz_bdrA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-15  4:52       ` Balbir Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox