Q: cgroup: Questions about possible issues in cgroup locking

Frederic Weisbecker fweisbec at gmail.com
Wed Dec 21 18:23:46 UTC 2011


On Wed, Dec 21, 2011 at 07:11:01PM +0100, Oleg Nesterov wrote:
> On 12/21, Frederic Weisbecker wrote:
> >
> > On Wed, Dec 21, 2011 at 02:08:48PM +0100, Oleg Nesterov wrote:
> > > On 12/21, Frederic Weisbecker wrote:
> > > > - By the time we call cgroup_post_fork(), it is ready to be woken up
> > > > and usable by the scheduler.
> > >
> > > No, the new child can't run until do_fork()->wake_up_new_task().
> >
> > Out of curiosity, why is it not possible for a task to kill and wake up the child
> > before that happens?
> 
> Because it is not possible to wake it up.
> 
> Please note that copy_process() creates the "deactivated" child, iow
> it is not on rq.
> 
> But, at the same time its ->state == TASK_RUNNING. This "fools"
> try_to_wake_up() or anything else which in theory could place it
> on the runqueue.

Aaah I see.

> 
> Except, of course, wake_up_new_task() does activate_task(). And
> note that it does this unconditionally, exactly because we know that
> this task can't be woken.
>

ok, thanks for the explanation!


More information about the Containers mailing list