From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Nesterov Subject: Re: [PATCH v2 5/7] clone4: Add a CLONE_AUTOREAP flag to automatically reap the child process Date: Fri, 20 Mar 2015 20:09:14 +0100 Message-ID: <20150320190914.GA28357@redhat.com> References: <20150315233439.GA31890@thin> <20150320181404.GA26343@redhat.com> <1766646.jusoNDOCPE@tjmaciei-mobl4> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1766646.jusoNDOCPE@tjmaciei-mobl4> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Thiago Macieira Cc: Josh Triplett , Al Viro , Andrew Morton , Andy Lutomirski , Ingo Molnar , Kees Cook , "Paul E. McKenney" , "H. Peter Anvin" , Rik van Riel , Thomas Gleixner , Michael Kerrisk , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org List-Id: linux-api@vger.kernel.org On 03/20, Thiago Macieira wrote: > > On Friday 20 March 2015 19:14:04 Oleg Nesterov wrote: > > Also. I forgot that the kernel always resets ->exit_signal to SIGCHLD on > > exec or reparenting. Reparenting is probably fine. But what about exec? > > Should it keep ->exit_signal == 0 if "autoreap" ? I think it should not, to > > avoid the strange special case. > > Not delivering any signal was the objective of this patch series, so yes > exit_signal == 0 should survive an exec and even re-exec. OK, but then perhaps we should never send SIGCHLD (on exit) if "autoreap", to make the logic simple. And copy_process() should probably do if ((clone_flags & CSIGNAL) && (clone_flags && CLONE_AUTOREAP)) return -EINVAL; so that we still can change this behaviour later. Oleg.