From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752088AbbCTVLG (ORCPT ); Fri, 20 Mar 2015 17:11:06 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:54733 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751494AbbCTVLE (ORCPT ); Fri, 20 Mar 2015 17:11:04 -0400 Date: Fri, 20 Mar 2015 14:10:55 -0700 From: josh@joshtriplett.org To: Oleg Nesterov Cc: Thiago Macieira , 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@vger.kernel.org, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v2 5/7] clone4: Add a CLONE_AUTOREAP flag to automatically reap the child process Message-ID: <20150320211055.GA13125@cloud> References: <20150315233439.GA31890@thin> <20150320181404.GA26343@redhat.com> <1766646.jusoNDOCPE@tjmaciei-mobl4> <20150320190914.GA28357@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150320190914.GA28357@redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 20, 2015 at 08:09:14PM +0100, Oleg Nesterov wrote: > 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. I'm fine with that, as it would handle the particular use case we care about. However, the reset-signal-on-reparent thing might still make sense, particularly for the ptrace-reparent case (less so for the reparent-to-child-reaper case). - Josh Triplett