[PATCH 6/6] Makes procs file writable to move all threads by tgid at once

Serge E. Hallyn serue at us.ibm.com
Tue Aug 4 12:01:39 PDT 2009

Quoting Paul Menage (menage at google.com):
> On Mon, Aug 3, 2009 at 12:45 PM, Serge E. Hallyn<serue at us.ibm.com> wrote:
> >
> > This is probably a stupid idea, but...  what about having zero
> > overhead at clone(), and instead, at cgroup_task_migrate(),
> > dequeue_task()ing all of the affected threads for the duration of
> > the migrate?
> >
> Or a simpler alternative - rather than taking the thread group
> leader's rwsem in cgroup_fork(), always take current's rwsem. Then
> you're always locking a (probably?) local rwsem and minimizing the
> overhead. So not quite zero overhead in the fork path, but I'd be
> surprised if it was measurable. In cgroup_attach_proc() you then have
> to take the rwsem of every thread in the process. Kind of the
> equivalent of a per-threadgroup big-reader lock.
> Paul

Yup I think that would addres my concern (cache-line bouncing in hot
clone(CLONE_THREAD) case).


More information about the Containers mailing list