From: Glauber Costa <glommer@parallels.com>
To: linux-kernel@vger.kernel.org
Cc: paul@paulmenage.org, lizf@cn.fujitsu.com, daniel.lezcano@free.fr,
a.p.zijlstra@chello.nl, jbottomley@parallels.com, pjt@google.com,
cgroups@vger.kernel.org, bsingharora@gmail.com, devel@openvz.org,
kamezawa.hiroyu@jp.fujitsu.com,
Glauber Costa <glommer@parallels.com>
Subject: [RFC] cgroup basic comounting
Date: Fri, 16 Dec 2011 16:29:09 +0400 [thread overview]
Message-ID: <1324038549-21605-1-git-send-email-glommer@parallels.com> (raw)
Turns out that most of the infrastructure we need to put two controllers in the
same hierarchy is by far already into place. All we need to do is not failing
when we specify two of them.
With this, we can effectively guarantee that by comounting cpu and cpuacct,
we'll have the same set of tasks, therefore allowing us to use cpu cgroup data
to fill in the usage fields in cpuacct.
I decided not to stabilish any dependency between cgroups as Li previously did:
cgroups may or may not be comounted, and any of them can be combined (I don't
see a reason to prevent any combination).
After testing and some trials, I could verify that the current mount behavior
plays well under the plans, so I didn't change it. That is:
* If subsystems A and B aren't mounted, we can comount them.
* If subsystem A is mounted, but B is not:
* we can comount them if A has no children,
* we fail otherwise
* If subsystems A and B are comounted at a location, we can't
mount any of them separately at another point. We do can mount
them together.
* If subsystems A and B are comounted at a location,
* we can comount a third subsystem C, if they have no children
* we fail otherwise
Paul,
Please let me know if this is tuned with the idea you had in mind.
If this is okay, I patch that extracts usage from cpu cgroup data
in case of comount would follow.
Signed-off-by: Glauber Costa <glommer@parallels.com>
CC: Paul Turner <pjt@google.com>
CC: Li Zefan <lizf@cn.fujitsu.com>
---
kernel/cgroup.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 1fd7867..e894a4f 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1211,9 +1211,9 @@ static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts)
set_bit(i, &opts->subsys_bits);
one_ss = true;
- break;
+ continue;
}
- if (i == CGROUP_SUBSYS_COUNT)
+ if (opts->subsys_bits == 0)
return -ENOENT;
}
--
1.7.6.4
next reply other threads:[~2011-12-16 12:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-16 12:29 Glauber Costa [this message]
2011-12-16 16:35 ` Paul Menage
2011-12-19 7:58 ` Li Zefan
2011-12-19 8:00 ` Glauber Costa
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=1324038549-21605-1-git-send-email-glommer@parallels.com \
--to=glommer@parallels.com \
--cc=a.p.zijlstra@chello.nl \
--cc=bsingharora@gmail.com \
--cc=cgroups@vger.kernel.org \
--cc=daniel.lezcano@free.fr \
--cc=devel@openvz.org \
--cc=jbottomley@parallels.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=paul@paulmenage.org \
--cc=pjt@google.com \
/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
all inboxes | Powered by JetHome®