The patch titled memory cgroup enhancements: add- pre_destroy() handler has been removed from the -mm tree. Its filename was memory-cgroup-enhancements-add-pre_destroy-handler.patch This patch was dropped because it was merged into mainline or a subsystem tree The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: memory cgroup enhancements: add- pre_destroy() handler From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxx> Cc: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx> Cc: Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Herbert Poetzl <herbert@xxxxxxxxxxxx> Cc: Kirill Korotaev <dev@xxxxx> Cc: Nick Piggin <nickpiggin@xxxxxxxxxxxx> Cc: Paul Menage <menage@xxxxxxxxxx> Cc: Pavel Emelianov <xemul@xxxxxxxxxx> Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> Cc: Vaidyanathan Srinivasan <svaidy@xxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/cgroup.h | 1 + kernel/cgroup.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff -puN include/linux/cgroup.h~memory-cgroup-enhancements-add-pre_destroy-handler include/linux/cgroup.h --- a/include/linux/cgroup.h~memory-cgroup-enhancements-add-pre_destroy-handler +++ a/include/linux/cgroup.h @@ -233,6 +233,7 @@ int cgroup_is_descendant(const struct cg 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); diff -puN kernel/cgroup.c~memory-cgroup-enhancements-add-pre_destroy-handler kernel/cgroup.c --- a/kernel/cgroup.c~memory-cgroup-enhancements-add-pre_destroy-handler +++ a/kernel/cgroup.c @@ -586,6 +586,21 @@ static struct inode *cgroup_new_inode(mo return inode; } +/* + * Call subsys's pre_destroy handler. + * This is called before css refcnt check. + */ + +static void cgroup_call_pre_destroy(struct cgroup *cgrp) +{ + struct cgroup_subsys *ss; + for_each_subsys(cgrp->root, ss) + if (ss->pre_destroy && cgrp->subsys[ss->subsys_id]) + ss->pre_destroy(ss, cgrp); + return; +} + + static void cgroup_diput(struct dentry *dentry, struct inode *inode) { /* is dentry a directory ? if so, kfree() associated cgroup */ @@ -2160,6 +2175,13 @@ static int cgroup_rmdir(struct inode *un parent = cgrp->parent; root = cgrp->root; sb = root->sb; + /* + * Call pre_destroy handlers of subsys + */ + cgroup_call_pre_destroy(cgrp); + /* + * Notify subsyses that rmdir() request comes. + */ if (cgroup_has_css_refs(cgrp)) { mutex_unlock(&cgroup_mutex); _ Patches currently in -mm which might be from kamezawa.hiroyu@xxxxxxxxxxxxxx are origin.patch enable-hotplug-memory-remove-for-ppc64.patch add-arch-specific-walk_memory_remove-for-ppc64.patch memory-hotplug-add-removable-to-sysfs-to-show-memblock-removability.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html