mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-01 03:11:59 +00:00
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>
This commit is contained in:
parent
d2ceb9b7dd
commit
4fca88c87b
2 changed files with 23 additions and 0 deletions
|
@ -233,6 +233,7 @@ int cgroup_is_descendant(const struct cgroup *cont);
|
|||
struct cgroup_subsys {
|
||||
struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss,
|
||||
struct cgroup *cont);
|
||||
void (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cont);
|
||||
void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cont);
|
||||
int (*can_attach)(struct cgroup_subsys *ss,
|
||||
struct cgroup *cont, struct task_struct *tsk);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue