summaryrefslogtreecommitdiff
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-05-14 09:15:02 -0400
committerTejun Heo <tj@kernel.org>2014-05-14 09:15:02 -0400
commit25e15d835036a70a53dcc993beaa036f8919a373 (patch)
tree614c37af62fefd7aebb697de761f04e5aa082dd3 /kernel/cgroup.c
parent249f3468a282dcbad53484c821bebb447f14ee03 (diff)
cgroup: bounce css release through css->destroy_work
css release is planned to do more and would require process context. Bounce it through css->destroy_work. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 4a94b0be598d..e694f4153edb 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4126,10 +4126,10 @@ static void css_free_rcu_fn(struct rcu_head *rcu_head)
queue_work(cgroup_destroy_wq, &css->destroy_work);
}
-static void css_release(struct percpu_ref *ref)
+static void css_release_work_fn(struct work_struct *work)
{
struct cgroup_subsys_state *css =
- container_of(ref, struct cgroup_subsys_state, refcnt);
+ container_of(work, struct cgroup_subsys_state, destroy_work);
struct cgroup_subsys *ss = css->ss;
cgroup_idr_remove(&ss->css_idr, css->id);
@@ -4137,6 +4137,15 @@ static void css_release(struct percpu_ref *ref)
call_rcu(&css->rcu_head, css_free_rcu_fn);
}
+static void css_release(struct percpu_ref *ref)
+{
+ struct cgroup_subsys_state *css =
+ container_of(ref, struct cgroup_subsys_state, refcnt);
+
+ INIT_WORK(&css->destroy_work, css_release_work_fn);
+ queue_work(cgroup_destroy_wq, &css->destroy_work);
+}
+
static void init_and_link_css(struct cgroup_subsys_state *css,
struct cgroup_subsys *ss, struct cgroup *cgrp)
{