From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [PATCH UPDATED 03/10] threadgroup: extend threadgroup_lock() to cover exit and exec Date: Mon, 5 Dec 2011 10:43:15 -0800 Message-ID: <20111205184315.GJ627@google.com> References: <1320191193-8110-1-git-send-email-tj@kernel.org> <1320191193-8110-4-git-send-email-tj@kernel.org> <20111124225054.GA14828@google.com> <20111125140136.GC23307@somewhere.redhat.com> <20111127193001.GC4266@google.com> <20111202162753.GA19752@somewhere.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20111202162753.GA19752-oHC15RC7JGTpAmv0O++HtFaTQe2KTcn/@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: Frederic Weisbecker Cc: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, paul-inf54ven1CmVyaH7bEyXVA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, rjw-KKrjLPT3xs0@public.gmane.org, linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Linus Torvalds , containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: containers.vger.kernel.org Hello, Frederic. On Fri, Dec 02, 2011 at 05:28:03PM +0100, Frederic Weisbecker wrote: > But I don't think it's very useful to protect against irq_exit_thread(), > what happens there is purely of internal irq interest. > > Then right after, PF_EXITING is set before any interesting change. > Isn't it possible to simply lock this flag setting? IIRC, as soon > as the PF_EXITING flag is set, you ignore the task for attachment. I think that's technically possible but it does introduce another class of tasks - the dying ones. e.g. If a task has PF_EXITING set and the containing process is migrating, we'll have to migrate all tasks but the dying one and cgroup ->exit callbacks can be called on the lonely task after the migration is complete. It's kinda messy and if someone makes a wrong assumption there, the bug is gonna be even more difficult to reproduce / track down than now. Yes, smaller scope locking is nicer but I would like to avoid api weirdities like that. Thanks. -- tejun