aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPaul Menage <menage@google.com>2008-04-29 04:00:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:09 -0400
commit3116f0e3df0a67ad56f15dd4c5f6cefb04bb4a98 (patch)
tree27dc8e1000eb7c3e36157963415a0bc8b8555e44 /kernel
parentc27e8818a09bbdfe7c07c629cb2c27e1a742e156 (diff)
CGroup API files: move "releasable" to cgroup_debug subsystem
The "releasable" control file provided by the cgroup framework exports the state of a per-cgroup flag that's related to the notify-on-release feature. This isn't really generally useful, unless you're trying to debug this particular feature of cgroups. This patch moves the "releasable" file to the cgroup_debug subsystem. Signed-off-by: Paul Menage <menage@google.com> Cc: "Li Zefan" <lizf@cn.fujitsu.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Paul Jackson <pj@sgi.com> Cc: Pavel Emelyanov <xemul@openvz.org> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: "YAMAMOTO Takashi" <yamamoto@valinux.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup.c23
-rw-r--r--kernel/cgroup_debug.c12
2 files changed, 11 insertions, 24 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 693bcc03188b..b5ef0c4772f7 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -119,17 +119,6 @@ static int root_count;
119 */ 119 */
120static int need_forkexit_callback; 120static int need_forkexit_callback;
121 121
122/* bits in struct cgroup flags field */
123enum {
124 /* Control Group is dead */
125 CGRP_REMOVED,
126 /* Control Group has previously had a child cgroup or a task,
127 * but no longer (only if CGRP_NOTIFY_ON_RELEASE is set) */
128 CGRP_RELEASABLE,
129 /* Control Group requires release notifications to userspace */
130 CGRP_NOTIFY_ON_RELEASE,
131};
132
133/* convenient tests for these bits */ 122/* convenient tests for these bits */
134inline int cgroup_is_removed(const struct cgroup *cgrp) 123inline int cgroup_is_removed(const struct cgroup *cgrp)
135{ 124{
@@ -1307,7 +1296,6 @@ enum cgroup_filetype {
1307 FILE_DIR, 1296 FILE_DIR,
1308 FILE_TASKLIST, 1297 FILE_TASKLIST,
1309 FILE_NOTIFY_ON_RELEASE, 1298 FILE_NOTIFY_ON_RELEASE,
1310 FILE_RELEASABLE,
1311 FILE_RELEASE_AGENT, 1299 FILE_RELEASE_AGENT,
1312}; 1300};
1313 1301
@@ -2186,11 +2174,6 @@ static u64 cgroup_read_notify_on_release(struct cgroup *cgrp,
2186 return notify_on_release(cgrp); 2174 return notify_on_release(cgrp);
2187} 2175}
2188 2176
2189static u64 cgroup_read_releasable(struct cgroup *cgrp, struct cftype *cft)
2190{
2191 return test_bit(CGRP_RELEASABLE, &cgrp->flags);
2192}
2193
2194/* 2177/*
2195 * for the common functions, 'private' gives the type of file 2178 * for the common functions, 'private' gives the type of file
2196 */ 2179 */
@@ -2210,12 +2193,6 @@ static struct cftype files[] = {
2210 .write = cgroup_common_file_write, 2193 .write = cgroup_common_file_write,
2211 .private = FILE_NOTIFY_ON_RELEASE, 2194 .private = FILE_NOTIFY_ON_RELEASE,
2212 }, 2195 },
2213
2214 {
2215 .name = "releasable",
2216 .read_u64 = cgroup_read_releasable,
2217 .private = FILE_RELEASABLE,
2218 }
2219}; 2196};
2220 2197
2221static struct cftype cft_release_agent = { 2198static struct cftype cft_release_agent = {
diff --git a/kernel/cgroup_debug.c b/kernel/cgroup_debug.c
index cbb7a26f4ea3..c3dc3aba4c02 100644
--- a/kernel/cgroup_debug.c
+++ b/kernel/cgroup_debug.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * kernel/ccontainer_debug.c - Example cgroup subsystem that 2 * kernel/cgroup_debug.c - Example cgroup subsystem that
3 * exposes debug info 3 * exposes debug info
4 * 4 *
5 * Copyright (C) Google Inc, 2007 5 * Copyright (C) Google Inc, 2007
@@ -62,6 +62,11 @@ static u64 current_css_set_refcount_read(struct cgroup *cont,
62 return count; 62 return count;
63} 63}
64 64
65static u64 releasable_read(struct cgroup *cgrp, struct cftype *cft)
66{
67 return test_bit(CGRP_RELEASABLE, &cgrp->flags);
68}
69
65static struct cftype files[] = { 70static struct cftype files[] = {
66 { 71 {
67 .name = "cgroup_refcount", 72 .name = "cgroup_refcount",
@@ -81,6 +86,11 @@ static struct cftype files[] = {
81 .name = "current_css_set_refcount", 86 .name = "current_css_set_refcount",
82 .read_u64 = current_css_set_refcount_read, 87 .read_u64 = current_css_set_refcount_read,
83 }, 88 },
89
90 {
91 .name = "releasable",
92 .read_u64 = releasable_read,
93 }
84}; 94};
85 95
86static int debug_populate(struct cgroup_subsys *ss, struct cgroup *cont) 96static int debug_populate(struct cgroup_subsys *ss, struct cgroup *cont)