From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Serge E. Hallyn" Subject: Re: [PATCH 6/6] Makes procs file writable to move all threads by tgid at once Date: Tue, 4 Aug 2009 14:01:39 -0500 Message-ID: <20090804190139.GA9896@us.ibm.com> References: <20090731012908.27908.62208.stgit@hastromil.mtv.corp.google.com> <20090731015154.27908.9639.stgit@hastromil.mtv.corp.google.com> <20090803175452.GA5481@us.ibm.com> <2f86c2480908031113y525b6cbdhe418b8a0364c7760@mail.gmail.com> <20090803185556.GA8469@us.ibm.com> <20090803194555.GA10158@us.ibm.com> <6599ad830908041148h6d3f3e9bxfef9f3eedec0ab6d@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <6599ad830908041148h6d3f3e9bxfef9f3eedec0ab6d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Paul Menage Cc: Benjamin Blum , containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: containers.vger.kernel.org Quoting Paul Menage (menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org): > On Mon, Aug 3, 2009 at 12:45 PM, Serge E. Hallyn wrote: > > > > This is probably a stupid idea, but... =A0what 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). thanks, -serge