diff options
author | Li Zefan <lizefan@huawei.com> | 2013-01-24 01:31:27 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-01-24 15:05:18 -0500 |
commit | 86a3db5643c7d29bb36ca85c7a4bb67ad4d88d77 (patch) | |
tree | 62fb73cc15fbcb751ee434a7bd9d1546851a4556 /kernel | |
parent | 2a73991b76cbd38c4a0c6704449ccc08c89c3ff3 (diff) |
cgroup: remove duplicate RCU free on struct cgroup
When destroying a cgroup, though in cgroup_diput() we've called
synchronize_rcu(), we then still have to free it via call_rcu().
The story is, long ago to fix a race between reading /proc/sched_debug
and freeing cgroup, the code was changed to utilize call_rcu(). See
commit a47295e6bc42ad35f9c15ac66f598aa24debd4e2 ("cgroups: make
cgroup_path() RCU-safe")
As we've fixed cpu cgroup that cpu_cgroup_offline_css() is used
to unregister a task_group so there won't be concurrent access
to this task_group after synchronize_rcu() in diput(). Now we can
just kfree(cgrp).
Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cgroup.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index a04932281bc9..af993919aa04 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -892,7 +892,7 @@ static void cgroup_diput(struct dentry *dentry, struct inode *inode) | |||
892 | simple_xattrs_free(&cgrp->xattrs); | 892 | simple_xattrs_free(&cgrp->xattrs); |
893 | 893 | ||
894 | ida_simple_remove(&cgrp->root->cgroup_ida, cgrp->id); | 894 | ida_simple_remove(&cgrp->root->cgroup_ida, cgrp->id); |
895 | kfree_rcu(cgrp, rcu_head); | 895 | kfree(cgrp); |
896 | } else { | 896 | } else { |
897 | struct cfent *cfe = __d_cfe(dentry); | 897 | struct cfent *cfe = __d_cfe(dentry); |
898 | struct cgroup *cgrp = dentry->d_parent->d_fsdata; | 898 | struct cgroup *cgrp = dentry->d_parent->d_fsdata; |