From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755698AbbCMWjY (ORCPT ); Fri, 13 Mar 2015 18:39:24 -0400 Received: from mail-la0-f53.google.com ([209.85.215.53]:34639 "EHLO mail-la0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753652AbbCMWjU (ORCPT ); Fri, 13 Mar 2015 18:39:20 -0400 MIME-Version: 1.0 In-Reply-To: <20150313223409.GE10954@cloud> References: <9c39c576e1d9a9912b4aec54d833a73a84d2f592.1426180120.git.josh@joshtriplett.org> <20150313162113.GA25966@redhat.com> <20150313195707.GA10487@cloud> <20150313222052.GC10954@cloud> <20150313223409.GE10954@cloud> From: Andy Lutomirski Date: Fri, 13 Mar 2015 15:38:58 -0700 Message-ID: Subject: Re: [PATCH 6/6] clone4: Introduce new CLONE_FD flag to get task exit notification via fd To: Josh Triplett Cc: Oleg Nesterov , Al Viro , Andrew Morton , Ingo Molnar , Kees Cook , "Paul E. McKenney" , "H. Peter Anvin" , Rik van Riel , Thomas Gleixner , Thiago Macieira , Michael Kerrisk , "linux-kernel@vger.kernel.org" , Linux API , Linux FS Devel , X86 ML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 13, 2015 at 3:34 PM, wrote: > On Fri, Mar 13, 2015 at 03:28:26PM -0700, Andy Lutomirski wrote: >> On Fri, Mar 13, 2015 at 3:20 PM, wrote: >> > On Fri, Mar 13, 2015 at 02:34:58PM -0700, Andy Lutomirski wrote: >> >> On Fri, Mar 13, 2015 at 12:57 PM, wrote: >> >> > A process launching a new process with CLONE_FD is explicitly requesting >> >> > that the process be automatically reaped without any other process >> >> > having to wait on it. The task needs to not become a zombie, because >> >> > otherwise, it'll show up in waitpid(-1, ...) calls in the parent >> >> > process, which would break the ability to use this to completely >> >> > encapsulate process management within a library and not interfere with >> >> > the parent's process handling via SIGCHLD and wait{pid,3,4}. >> >> >> >> Wouldn't the correct behavior be to keep it alive as a zombie but >> >> *not* show it in waitpid, etc? >> > >> > That's a significant change to the semantics of waitpid. And then >> > someone would still need to wait on the process, which we'd like to >> > avoid. (We don't want to have magic "reap on read(2)" semantics, >> > because among other things, what if we add a means in the future to get >> > an additional file descriptor corresponding to an existing process?) >> >> Do we not already have a state "dead, successfully waited on by >> parent, but still around because ptraced"? If not, shouldn't we? >> Isn't that what PTRACE_SEIZE does? Or am I just confused? > > I don't think that affects the task's exit_state though. > That's a question for Oleg. I have no idea how ptrace is actually implemented. --Andy > - Josh Triplett -- Andy Lutomirski AMA Capital Management, LLC