From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sukadev Bhattiprolu Subject: Re: CLONE_PARENT in a container Date: Thu, 19 Mar 2009 19:07:49 -0700 Message-ID: <20090320020749.GA31179@us.ibm.com> References: <49C2C819.4070802@cs.columbia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <49C2C819.4070802-eQaUEPhvms7ENvBUuze7eA@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: Oren Laadan Cc: Linux Containers , Oleg Nesterov , "Eric W. Biederman" List-Id: containers.vger.kernel.org Cc: Oleg, Eric Oren Laadan [orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org] wrote: | | What happens when a container-init calls clone() with the | CLONE_PARENT flag set ? | | Since CLONE_PARENT can be used to create a sibling, I'd | think that this will create a sibling, in particular, a | new task in the same container whose parent is the parent | of the container. From a quick look in the code I can't | see why this would be impossible. | | Is this so ? Is this the desired behavior ? Good question. CLONE_PARENT was discussed recently on lkml but did not look obvious to me who uses it or what the semantics are. Some observations. - the "reaper" for this sibling would be the reaper of the parent container, not the init of the new container. - if container-init exits, this sibling will also be killed since it has a pid in this container. Not sure if it needs to be prevented though. An using CLONE_PARENT may want to run as a container-init :-) And if CLONE_PARENT is used with CLONE_THREAD, we don't want to preclude threaded container-inits. Sukadev