Re: [PATCH] cgroups: don't cache common ancestor in task countersubsys

From: Li Zefan
Date: Mon Oct 17 2011 - 23:16:23 EST


>> @@ -2151,7 +2151,7 @@ int cgroup_attach_proc(struct cgroup *cgrp, struct task_struct *leader)
>> }
>> } else if (retval == -ESRCH) {
>> if (ss->cancel_attach_task)
>> - ss->cancel_attach_task(cgrp, tsk);
>> + ss->cancel_attach_task(cgrp, oldcgrp, tsk);
>> } else {
>> BUG_ON(1);
>> }
>> @@ -2191,7 +2191,8 @@ out_cancel_attach:
>> tsk = flex_array_get_ptr(group, i);
>> if (tsk == failed_task)
>> break;
>> - ss->cancel_attach_task(cgrp, tsk);
>> + ss->cancel_attach_task(cgrp, oldcgrp,
>> + tsk);
>
> When we rollback there, we are dealing with oldcgrp of the last thread
> we have treated. All threads in the rollback list don't necessary belonged
> to that old_cgroup.
>

Good point. I didn't look carefully at this case.

> And we can't try to retrieve these old_cgroup through task_cgroup_from_root() because
> the threads might have exited and thus could be assigned to the init cgroup.
>
> I believe we need to cache these old cgroups in the flex array.
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/