diff options
author | Paul Menage <menage@google.com> | 2007-10-19 02:39:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-19 14:53:36 -0400 |
commit | bbcb81d09104f0d440974b994c1fc508ccbe9503 (patch) | |
tree | 6d9ef3e2c611bb0a8f63519196f7bd7725b7ea1a /include | |
parent | ddbcc7e8e50aefe467c01cac3dec71f118cd8ac2 (diff) |
Task Control Groups: add tasks file interface
Add the per-directory "tasks" file for cgroupfs mounts; this allows the
user to determine which tasks are members of a cgroup by reading a
cgroup's "tasks", and to move a task into a cgroup by writing its pid to
its "tasks".
Signed-off-by: Paul Menage <menage@google.com>
Cc: Serge E. Hallyn <serue@us.ibm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Dave Hansen <haveblue@us.ibm.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Paul Jackson <pj@sgi.com>
Cc: Kirill Korotaev <dev@openvz.org>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Srivatsa Vaddagiri <vatsa@in.ibm.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/cgroup.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 60735dcf427a..e2dd44f68f97 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -144,6 +144,16 @@ int cgroup_is_removed(const struct cgroup *cont); | |||
144 | 144 | ||
145 | int cgroup_path(const struct cgroup *cont, char *buf, int buflen); | 145 | int cgroup_path(const struct cgroup *cont, char *buf, int buflen); |
146 | 146 | ||
147 | int __cgroup_task_count(const struct cgroup *cont); | ||
148 | static inline int cgroup_task_count(const struct cgroup *cont) | ||
149 | { | ||
150 | int task_count; | ||
151 | rcu_read_lock(); | ||
152 | task_count = __cgroup_task_count(cont); | ||
153 | rcu_read_unlock(); | ||
154 | return task_count; | ||
155 | } | ||
156 | |||
147 | /* Return true if the cgroup is a descendant of the current cgroup */ | 157 | /* Return true if the cgroup is a descendant of the current cgroup */ |
148 | int cgroup_is_descendant(const struct cgroup *cont); | 158 | int cgroup_is_descendant(const struct cgroup *cont); |
149 | 159 | ||