[PATCH cgroup/for-3.7-fixes 1/2] Revert "cgroup: Remove task_lock() from cgroup_post_fork()"

Tejun Heo tj at kernel.org
Fri Oct 19 19:38:08 UTC 2012


On Fri, Oct 19, 2012 at 09:35:26AM -0400, Frederic Weisbecker wrote:
> 2012/10/18 Tejun Heo <tj at kernel.org>:
> > From d935a5d6832a264ce52f4257e176f4f96cbaf048 Mon Sep 17 00:00:00 2001
> > From: Tejun Heo <tj at kernel.org>
> > Date: Thu, 18 Oct 2012 17:40:30 -0700
> >
> > This reverts commit 7e3aa30ac8c904a706518b725c451bb486daaae9.
> >
> > The commit incorrectly assumed that fork path always performed
> > threadgroup_change_begin/end() and depended on that for
> > synchronization against task exit and cgroup migration paths instead
> > of explicitly grabbing task_lock().
> >
> > threadgroup_change is not locked when forking a new process (as
> > opposed to a new thread in the same process) and even if it were it
> > wouldn't be effective as different processes use different threadgroup
> > locks.
> >
> > Revert the incorrect optimization.
> 
> Ok but there is still no good reason to task_lock() there. But the
> comment is indeed wrong,  how about fixing it instead? I can send you
> a patch for that.

For -stable, I think it's better to revert.  If you want to remove
task_lock, let's do it for 3.8.

Thanks.

-- 
tejun


More information about the Containers mailing list