diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2008-02-07 03:14:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 11:42:20 -0500 |
commit | 4fca88c87b7969c698912e2de9b1b31088c777cb (patch) | |
tree | 6a086aaffb4ec17eadd2f2427c5816a02be6606f /include/linux | |
parent | d2ceb9b7ddedbb2e8e590bc6ce33c854043016f9 (diff) |
memory cgroup enhancements: add- pre_destroy() handler
Add a handler "pre_destroy" to cgroup_subsys. It is called before
cgroup_rmdir() checks all subsys's refcnt.
I think this is useful for subsys which have some extra refs even if there
are no tasks in cgroup. By adding pre_destroy(), the kernel keeps the rule
"destroy() against subsystem is called only when refcnt=0." and allows css
ref to be used by other objects than tasks.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Kirill Korotaev <dev@sw.ru>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Paul Menage <menage@google.com>
Cc: Pavel Emelianov <xemul@openvz.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/cgroup.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 87479328d46d..d8e92223a79c 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -233,6 +233,7 @@ int cgroup_is_descendant(const struct cgroup *cont); | |||
233 | struct cgroup_subsys { | 233 | struct cgroup_subsys { |
234 | struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss, | 234 | struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss, |
235 | struct cgroup *cont); | 235 | struct cgroup *cont); |
236 | void (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cont); | ||
236 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cont); | 237 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cont); |
237 | int (*can_attach)(struct cgroup_subsys *ss, | 238 | int (*can_attach)(struct cgroup_subsys *ss, |
238 | struct cgroup *cont, struct task_struct *tsk); | 239 | struct cgroup *cont, struct task_struct *tsk); |