public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
From: james <wjn740-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: John Wei <johntwei-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	'LKML-cgroups' <cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: How cpu entitlement is calculated/enforce for cpu subgroup?
Date: Mon, 15 Sep 2014 10:46:13 +0800	[thread overview]
Message-ID: <541652F5.5010604@gmail.com> (raw)
In-Reply-To: <08a001cfd07f$2219bd90$664d38b0$@gmail.com>

在 2014年09月15日 08:51, John Wei 写道:
> 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.
> 

hi sir,

I'm a nobody.
when there are 2 groups in level 1st (A and B), then A=50% and
B=50%(because A=1024 , B=1024 they are same. so they will have the same
priority get cpu time).
and in the subgroup should following above-mentioned rules.(in same level).

And in this scenario ,when B group no processes,then A group will be 100%.

ok ,this is my point.

welcome any body to correct me.

> 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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2014-09-15  2:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-15  0:51 How cpu entitlement is calculated/enforce for cpu subgroup? John Wei
2014-09-15  2:46 ` james [this message]
     [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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=541652F5.5010604@gmail.com \
    --to=wjn740-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=johntwei-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox