Re: [PATCH v2 5/7] clone4: Add a CLONE_AUTOREAP flag to automatically reap the child process

2015-03-20 Thread josh
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

Re: [PATCH v2 5/7] clone4: Add a CLONE_AUTOREAP flag to automatically reap the child process

2015-03-20 Thread Oleg Nesterov
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

Re: [PATCH v2 5/7] clone4: Add a CLONE_AUTOREAP flag to automatically reap the child process

2015-03-20 Thread Thiago Macieira
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 strang

Re: [PATCH v2 5/7] clone4: Add a CLONE_AUTOREAP flag to automatically reap the child process

2015-03-20 Thread Oleg Nesterov
Josh, I am really sorry for delay. On 03/15, Josh Triplett wrote: > > On Sun, Mar 15, 2015 at 08:55:06PM +0100, Oleg Nesterov wrote: > > > It should be per-process simply because this "autoreap" affects the whole > > process. And the sub-threads are already "autoreap". And these 2 autoreap's > >

Re: [PATCH v2 5/7] clone4: Add a CLONE_AUTOREAP flag to automatically reap the child process

2015-03-15 Thread Josh Triplett
On Sun, Mar 15, 2015 at 08:55:06PM +0100, Oleg Nesterov wrote: > On 03/15, Josh Triplett wrote: > > On Sun, Mar 15, 2015 at 03:52:23PM +0100, Oleg Nesterov wrote: > > > On 03/15, Josh Triplett wrote: > > > > Add a CLONE_AUTOREAP flag to request this behavior unconditionally, > > > > > > Yes, CLONE_

Re: [PATCH v2 5/7] clone4: Add a CLONE_AUTOREAP flag to automatically reap the child process

2015-03-15 Thread Oleg Nesterov
On 03/15, Josh Triplett wrote: > > On Sun, Mar 15, 2015 at 03:52:23PM +0100, Oleg Nesterov wrote: > > On 03/15, Josh Triplett wrote: > > > Add a CLONE_AUTOREAP flag to request this behavior unconditionally, > > > > Yes, CLONE_AUTOREAP is much better. And I agree (mostly) with that > > we should rel

Re: [PATCH v2 5/7] clone4: Add a CLONE_AUTOREAP flag to automatically reap the child process

2015-03-15 Thread Josh Triplett
On Sun, Mar 15, 2015 at 03:52:23PM +0100, Oleg Nesterov wrote: > On 03/15, Josh Triplett wrote: > > Add a CLONE_AUTOREAP flag to request this behavior unconditionally, > > Yes, CLONE_AUTOREAP is much better. And I agree (mostly) with that > we should rely on do_notify_parent(). > > Howver the pat

Re: [PATCH v2 5/7] clone4: Add a CLONE_AUTOREAP flag to automatically reap the child process

2015-03-15 Thread Oleg Nesterov
On 03/15, Josh Triplett wrote: > > Add a CLONE_AUTOREAP flag to request this behavior unconditionally, Yes, CLONE_AUTOREAP is much better. And I agree (mostly) with that we should rely on do_notify_parent(). Howver the patch still doesn't look right. First of all, ->autoreap should be per-process

[PATCH v2 5/7] clone4: Add a CLONE_AUTOREAP flag to automatically reap the child process

2015-03-15 Thread Josh Triplett
If a process launches a child process with the notification signal set to SIGCHLD (e.g. with fork()), and then the parent process either ignores SIGCHLD or sets a handler with SA_NOCLDWAIT, the child process will get automatically reaped without waiting for the parent to wait on it. However, there