lkml.org 
[lkml]   [2011]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4] cgroup: always lock threadgroup during migration
On 09/05, Tejun Heo wrote:
>
> * Remove -ESRCH failure path from cgroup_task_migrate(). With the
> above changes, it's guaranteed to be called only for live tasks.

I think you can remove another similar check,

> @@ -2044,6 +2044,10 @@ int cgroup_attach_proc(struct cgroup *cgrp, struct task_struct *leader)
> tsk = leader;
> i = 0;
> do {
> + /* @tsk either already exited or can't exit until the end */
> + if (tsk->flags & PF_EXITING)
> + continue;
> +
> /* as per above, nr_threads may decrease, but not increase. */
> BUG_ON(i >= group_size);
> get_task_struct(tsk);

And then cgroup_attach_proc() does

for (i = 0; i < group_size; i++) {
...
task_lock(tsk);
if (tsk->flags & PF_EXITING) {
task_unlock(tsk);
continue;
Afaics, this is no longer needed.

Oleg.



\
 
 \ /
  Last update: 2011-09-18 19:47    [from the cache]
©2003-2011 Jasper Spaans