CC: Tejun 于 2013/2/6 23:16, Maxim Uvarov wrote: > linux-3.0.y has put_css_set a litte bit down in the code, > this should not be duplicated.
Why do you want to make this change? Have you encountered some kernel bug that relates to cgroup? > Signed-off-by: Maxim Uvarov <[email protected]> NAck > --- > kernel/cgroup.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/kernel/cgroup.c b/kernel/cgroup.c > index 1749dcd..2a08524 100644 > --- a/kernel/cgroup.c > +++ b/kernel/cgroup.c > @@ -1777,7 +1777,6 @@ static int cgroup_task_migrate(struct cgroup *cgrp, > struct cgroup *oldcgrp, > return -ENOMEM; > } > } > - put_css_set(oldcg); This put_css_set() is paired with the code a little above: task_lock(tsk); oldcg = tsk->cgroups; get_css_set(oldcg); task_unlock(tsk); It was added by this commit: commit 77efecd9e0526327548152df715ab8644ecb5ba0 Author: Lai Jiangshan <[email protected]> Date: Wed Jan 7 18:07:39 2009 -0800 cgroups: call find_css_set() safely in cgroup_attach_task() And the put_css_set() at the end of this function is to really drop the ref to tsk->cgroups, as tsk->cgroups will point to @newcg, so @oldcg should be de-referenced. But yeah the comment above the second put_css_set() is confusing: /* * We just gained a reference on oldcg by taking it from the task ... * ... */ I'll fix the comment for mainline. > > /* if PF_EXITING is set, the tsk->cgroups pointer is no longer safe. */ > task_lock(tsk); > -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
