Re: [PATCH 3/4] threadgroup: extend threadgroup_lock() to coverexit and exec
From: Oleg Nesterov
Date: Sun Sep 18 2011 - 14:50:31 EST
On 09/18, Oleg Nesterov wrote:
>
> Of course I am in no position to ack the changes in this code, I do not
> fell I understand it enough. But afaics this series is fine.
^^^^
I do not feel ;)
> If I am right, afaics the only change 4/4 needs is that it should not add
> WARN_ON_ONCE(tsk->flags & PF_EXITING) into cgroup_task_migrate().
Hmm. Unless I missed something this WARN_ON_ONCE() is not right anyway,
because
> - * Call holding cgroup_mutex. May take task_lock of
> - * the task 'tsk' during call.
> + * Call with cgroup_mutex and threadgroup locked. May take task_lock of
> + * @tsk during call.
> */
> int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
this is not true, cgroup_attach_proc() has other callers.
cgroup_attach_task_all() is probably fine, tsk should be current.
but cpuset_do_move_task() doesn't look fine at first glance, we can race
with the exiting task.
And this leads to another question about the cgroup_mutex/threadgroup_lock
nesting...
Oleg.
--
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/