[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150314220905.GJ22130@thin>
Date: Sat, 14 Mar 2015 15:09:05 -0700
From: Josh Triplett <josh@...htriplett.org>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Al Viro <viro@...iv.linux.org.uk>,
Andrew Morton <akpm@...ux-foundation.org>,
Andy Lutomirski <luto@...capital.net>,
Ingo Molnar <mingo@...hat.com>,
Kees Cook <keescook@...omium.org>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
"H. Peter Anvin" <hpa@...or.com>, Rik van Riel <riel@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Thiago Macieira <thiago.macieira@...el.com>,
Michael Kerrisk <mtk.manpages@...il.com>,
linux-kernel@...r.kernel.org, linux-api@...r.kernel.org,
linux-fsdevel@...r.kernel.org, x86@...nel.org
Subject: Re: [PATCH 6/6] clone4: Introduce new CLONE_FD flag to get task exit
notification via fd
On Sat, Mar 14, 2015 at 03:14:14PM +0100, Oleg Nesterov wrote:
> Again, again, I didn't read this series yet. But the proper solution (afaics)
> should move this "autoreap" check in release_task/__ptrace_detach(). If the
> task is traced. Debugger should check ->autoreap and skip another
> do_notify_parent().
As mentioned in the mail I just sent, I think I can just move the
autoreap handling *into* do_notify_parent, and treat it as though the
parent had SA_NOCLDWAIT set.
> Speaking of autoreap... If ->exit_signal is zero, then the exiting child
> doesn't send the notification to its parent, still it doesn't autoreap
> itself. To me this looks strange, and in fact it seems to me that this
> is only by mistake. I am wondering if we can treat ->exit_signal == 0
> as "autoreap" too. As usual, most probably the answer is "no, because it
> is too late to change the historical behaviour". But this is off-topic.
Historical behavior, and potentially sensible behavior; you might not
want notification, but you might still want to get the child's exit
status by calling wait, which means you need the process to stick around
as a zombie until you wait on it.
That'd be the main advantage of adding a CLONE_AUTOREAP flag: it allows
you to get the same autoreaping behavior you'd get if you had SIGCHLD
ignored, but without actually sending a signal and without caring how
the process-wide signal handling is set up. So you'd pass a 0 signal,
and CLONE_AUTOREAP. And then if you *want* the exit notification, you
can get it via the file descriptor.
- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists