From: Li Zefan <lizf@cn.fujitsu.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Paul Menage <menage@google.com>,
Peter Zijlstra <peterz@infradead.org>,
Hiroyuki KAMEZAWA <kamezawa.hiroyu@jp.fujitsu.com>,
Matt Helsley <matthltc@us.ibm.com>,
Stephane Eranian <eranian@google.com>,
LKML <linux-kernel@vger.kernel.org>,
containers@lists.linux-foundation.org,
Ingo Molnar <mingo@elte.hu>,
serge@hallyn.com
Subject: [PATCH v2 4/6] cgroups: Mark some subsystems bindable/unbindable
Date: Wed, 15 Dec 2010 17:36:05 +0800 [thread overview]
Message-ID: <4D088C05.5060701@cn.fujitsu.com> (raw)
In-Reply-To: <4D088BB5.30903@cn.fujitsu.com>
For those subsystems (debug, cpuacct, net_cls and devices),
setting the bindable/unbindable flag is sufficient.
Set freezer subsystem as bindable but not unbindable, because
sub-cgroups' can be in FROZEN state.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
kernel/cgroup.c | 6 +++++-
kernel/cgroup_freezer.c | 1 +
kernel/sched.c | 2 ++
security/device_cgroup.c | 2 ++
4 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 463575d..fa2c5de 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1063,6 +1063,8 @@ static int hierarchy_reset_css_refs(struct cgroup *cgrp, void *data)
int i;
for_each_set_bit(i, &removed_bits, CGROUP_SUBSYS_COUNT) {
+ struct cgroup_subsys_state *css = cgrp->subsys[i];
+
if (atomic_read(&css->refcnt) == 0)
atomic_set(&css->refcnt, 1);
}
@@ -1086,7 +1088,7 @@ static int hierarchy_clear_css_refs(struct cgroup *cgrp, void *data)
}
return 0;
failed:
- hierarchy_reset_css_refs(struct cgroup *cgrp, void *data);
+ hierarchy_reset_css_refs(cgrp, data);
return -EBUSY;
}
@@ -5201,5 +5203,7 @@ struct cgroup_subsys debug_subsys = {
.destroy = debug_destroy,
.populate = debug_populate,
.subsys_id = debug_subsys_id,
+ .bindable = true,
+ .unbindable = true,
};
#endif /* CONFIG_CGROUP_DEBUG */
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index e7bebb7..213ecd9 100644
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -393,4 +393,5 @@ struct cgroup_subsys freezer_subsys = {
.attach = NULL,
.fork = freezer_fork,
.exit = NULL,
+ .bindable = true,
};
diff --git a/kernel/sched.c b/kernel/sched.c
index dc91a4d..930ee2e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -9346,6 +9346,8 @@ struct cgroup_subsys cpuacct_subsys = {
.destroy = cpuacct_destroy,
.populate = cpuacct_populate,
.subsys_id = cpuacct_subsys_id,
+ .bindable = true,
+ .unbindable = true,
};
#endif /* CONFIG_CGROUP_CPUACCT */
diff --git a/security/device_cgroup.c b/security/device_cgroup.c
index 8d9c48f..51321e9 100644
--- a/security/device_cgroup.c
+++ b/security/device_cgroup.c
@@ -473,6 +473,8 @@ struct cgroup_subsys devices_subsys = {
.destroy = devcgroup_destroy,
.populate = devcgroup_populate,
.subsys_id = devices_subsys_id,
+ .bindable = true,
+ .unbindable = true,
};
int devcgroup_inode_permission(struct inode *inode, int mask)
--
1.6.3
next prev parent reply other threads:[~2010-12-15 9:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-15 9:34 [PATCH v2 0/6] cgroups: Bindable cgroup subsystems Li Zefan
2010-12-15 9:35 ` [PATCH v2 1/6] cgroups: Shrink struct cgroup_subsys Li Zefan
2010-12-15 9:35 ` [PATCH v2 2/6] cgroups: Allow to bind a subsystem to a cgroup hierarchy Li Zefan
2010-12-15 9:35 ` [PATCH v2 3/6] cgroups: Allow to unbind subsystem from " Li Zefan
2010-12-15 9:36 ` Li Zefan [this message]
2010-12-15 9:36 ` [PATCH v2 5/6] cgroups: Triger BUG if a bindable subsystem calls css_get() Li Zefan
2010-12-15 9:36 ` [PATCH v2 6/6] cgroups: Update documentation for bindable subsystems Li Zefan
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=4D088C05.5060701@cn.fujitsu.com \
--to=lizf@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=containers@lists.linux-foundation.org \
--cc=eranian@google.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthltc@us.ibm.com \
--cc=menage@google.com \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=serge@hallyn.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