summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill@shutemov.name>2010-03-10 15:22:34 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-12 15:52:37 -0800
commita0a4db548edcce067c1201ef25cf2bc29f32dca4 (patch)
tree6f8139a582179666cd248d978332ed0e32ad9f0f /mm
parent4ab78683c17d739c2a2077141dcf81a02b7fb57e (diff)
downloadlinux-stable-a0a4db548edcce067c1201ef25cf2bc29f32dca4.tar.gz
linux-stable-a0a4db548edcce067c1201ef25cf2bc29f32dca4.tar.bz2
linux-stable-a0a4db548edcce067c1201ef25cf2bc29f32dca4.zip
cgroups: remove events before destroying subsystem state objects
Events should be removed after rmdir of cgroup directory, but before destroying subsystem state objects. Let's take reference to cgroup directory dentry to do that. Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hioryu@jp.fujitsu.com> Cc: Paul Menage <menage@google.com> Acked-by: Li Zefan <lizf@cn.fujitsu.com> Cc: Balbir Singh <balbir@linux.vnet.ibm.com> Cc: Pavel Emelyanov <xemul@openvz.org> Cc: Dan Malek <dan@embeddedalley.com> Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memcontrol.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index f9ae4b4c36eb..f7b910fc14fb 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3361,12 +3361,6 @@ static int mem_cgroup_register_event(struct cgroup *cgrp, struct cftype *cft,
}
}
- /*
- * We need to increment refcnt to be sure that all thresholds
- * will be unregistered before calling __mem_cgroup_free()
- */
- mem_cgroup_get(memcg);
-
if (type == _MEM)
rcu_assign_pointer(memcg->thresholds, thresholds_new);
else
@@ -3460,9 +3454,6 @@ assign:
/* To be sure that nobody uses thresholds before freeing it */
synchronize_rcu();
- for (i = 0; i < thresholds->size - size; i++)
- mem_cgroup_put(memcg);
-
kfree(thresholds);
unlock:
mutex_unlock(&memcg->thresholds_lock);