* [PATCH] prctl.2: Document new PR_SET_CHILD_SUBREAPER semantics
[not found] ` <20170127100543.18390-1-ptikhomirov-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
@ 2017-01-27 10:11 ` Pavel Tikhomirov
[not found] ` <20170127101125.18709-1-ptikhomirov-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Pavel Tikhomirov @ 2017-01-27 10:11 UTC (permalink / raw)
To: Michael Kerrisk
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, Ingo Molnar, Peter Zijlstra,
Andrew Morton, Cyrill Gorcunov, John Stultz, Thomas Gleixner,
Oleg Nesterov, Nicolas Pitre, Michal Hocko, Stanislav Kinsburskiy,
Mateusz Guzik, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
Pavel Emelyanov, Konstantin Khorenko, Pavel Tikhomirov,
Lennart Poettering, Eric W . Biederman, Kay Sievers
old semantics was non deterministic and worked differently
depending on the external factors, but nothing changes if
process first sets itself subreaper and only after forks
Signed-off-by: Pavel Tikhomirov <ptikhomirov-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
---
man2/prctl.2 | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/man2/prctl.2 b/man2/prctl.2
index 97cf21a..84fbd7e 100644
--- a/man2/prctl.2
+++ b/man2/prctl.2
@@ -162,20 +162,30 @@ if
is zero, unset the attribute.
When a process is marked as a child subreaper,
-all of the children that it creates, and their descendants,
+all of the children that it creates or have created already, and their descendants,
will be marked as having a subreaper.
In effect, a subreaper fulfills the role of
.BR init (1)
for its descendant processes.
-Upon termination of a process
-that is orphaned (i.e., its immediate parent has already terminated)
-and marked as having a subreaper,
-the nearest still living ancestor subreaper
-will receive a
+Upon termination of a process having a subreaper,
+all its children become orphaned
+and will be reparented to the nearest still living ancestor subreaper.
+So that on it's adopted child termination
+these subreaper will receive a
.BR SIGCHLD
signal and will be able to
.BR wait (2)
-on the process to discover its termination status.
+on the child to discover its termination status.
+
+Note, that on older kernels these prctl works slightly different.
+Child subreaper process was not actualy the
+.BR init (1)
+for all its descendants.
+If process forks a child while not been a child subreaper,
+and after sets himself child subreaper,
+sub-tree of the child might or might not reparent to the subreaper,
+depending on the configuration of ancestors of the subreaper,
+at the time of forking our subtree.
.TP
.BR PR_GET_CHILD_SUBREAPER " (since Linux 3.4)"
Return the "child subreaper" setting of the caller,
--
2.9.3
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] prctl.2: Document new PR_SET_CHILD_SUBREAPER semantics
[not found] ` <20170127101125.18709-1-ptikhomirov-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
@ 2017-01-27 22:47 ` Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkhg-JankZ1LNV38DHtat5HrUKKK1YO2s1figbHQ5GMhcQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Michael Kerrisk (man-pages) @ 2017-01-27 22:47 UTC (permalink / raw)
To: Pavel Tikhomirov
Cc: linux-man, Ingo Molnar, Peter Zijlstra, Andrew Morton,
Cyrill Gorcunov, John Stultz, Thomas Gleixner, Oleg Nesterov,
Nicolas Pitre, Michal Hocko, Stanislav Kinsburskiy, Mateusz Guzik,
lkml, Pavel Emelyanov, Konstantin Khorenko, Lennart Poettering,
Eric W . Biederman, Kay Sievers
Hello Pavel,
On 27 January 2017 at 23:11, Pavel Tikhomirov <ptikhomirov-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org> wrote:
> old semantics was non deterministic and worked differently
> depending on the external factors, but nothing changes if
> process first sets itself subreaper and only after forks
When did the kernel behavior change?
Cheers,
Michael
> Signed-off-by: Pavel Tikhomirov <ptikhomirov-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
> ---
> man2/prctl.2 | 24 +++++++++++++++++-------
> 1 file changed, 17 insertions(+), 7 deletions(-)
>
> diff --git a/man2/prctl.2 b/man2/prctl.2
> index 97cf21a..84fbd7e 100644
> --- a/man2/prctl.2
> +++ b/man2/prctl.2
> @@ -162,20 +162,30 @@ if
> is zero, unset the attribute.
>
> When a process is marked as a child subreaper,
> -all of the children that it creates, and their descendants,
> +all of the children that it creates or have created already, and their descendants,
> will be marked as having a subreaper.
> In effect, a subreaper fulfills the role of
> .BR init (1)
> for its descendant processes.
> -Upon termination of a process
> -that is orphaned (i.e., its immediate parent has already terminated)
> -and marked as having a subreaper,
> -the nearest still living ancestor subreaper
> -will receive a
> +Upon termination of a process having a subreaper,
> +all its children become orphaned
> +and will be reparented to the nearest still living ancestor subreaper.
> +So that on it's adopted child termination
> +these subreaper will receive a
> .BR SIGCHLD
> signal and will be able to
> .BR wait (2)
> -on the process to discover its termination status.
> +on the child to discover its termination status.
> +
> +Note, that on older kernels these prctl works slightly different.
> +Child subreaper process was not actualy the
> +.BR init (1)
> +for all its descendants.
> +If process forks a child while not been a child subreaper,
> +and after sets himself child subreaper,
> +sub-tree of the child might or might not reparent to the subreaper,
> +depending on the configuration of ancestors of the subreaper,
> +at the time of forking our subtree.
> .TP
> .BR PR_GET_CHILD_SUBREAPER " (since Linux 3.4)"
> Return the "child subreaper" setting of the caller,
> --
> 2.9.3
>
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] prctl.2: Document new PR_SET_CHILD_SUBREAPER semantics
[not found] ` <CAKgNAkhg-JankZ1LNV38DHtat5HrUKKK1YO2s1figbHQ5GMhcQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-01-28 6:38 ` Pavel Tikhomirov
0 siblings, 0 replies; 3+ messages in thread
From: Pavel Tikhomirov @ 2017-01-28 6:38 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w
Cc: linux-man, Ingo Molnar, Peter Zijlstra, Andrew Morton,
Cyrill Gorcunov, John Stultz, Thomas Gleixner, Oleg Nesterov,
Nicolas Pitre, Michal Hocko, Stanislav Kinsburskiy, Mateusz Guzik,
lkml, Pavel Emelyanov, Konstantin Khorenko, Lennart Poettering,
Eric W . Biederman, Kay Sievers
On 01/28/2017 01:47 AM, Michael Kerrisk (man-pages) wrote:
> Hello Pavel,
>
> On 27 January 2017 at 23:11, Pavel Tikhomirov <ptikhomirov-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org> wrote:
>> old semantics was non deterministic and worked differently
>> depending on the external factors, but nothing changes if
>> process first sets itself subreaper and only after forks
>
> When did the kernel behavior change?
Sorry for inconvenience, should have added you to cc of a main patch also.
Kernel behavior haven't changed yet, doc change will be a continuation
of "[PATCH v2 0/2] prctl: make PR_SET_CHILD_SUBREAPER deterministic",
see https://lkml.org/lkml/2017/1/27/108
>
> Cheers,
>
> Michael
>
>
>> Signed-off-by: Pavel Tikhomirov <ptikhomirov-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
>> ---
>> man2/prctl.2 | 24 +++++++++++++++++-------
>> 1 file changed, 17 insertions(+), 7 deletions(-)
>>
>> diff --git a/man2/prctl.2 b/man2/prctl.2
>> index 97cf21a..84fbd7e 100644
>> --- a/man2/prctl.2
>> +++ b/man2/prctl.2
>> @@ -162,20 +162,30 @@ if
>> is zero, unset the attribute.
>>
>> When a process is marked as a child subreaper,
>> -all of the children that it creates, and their descendants,
>> +all of the children that it creates or have created already, and their descendants,
>> will be marked as having a subreaper.
>> In effect, a subreaper fulfills the role of
>> .BR init (1)
>> for its descendant processes.
>> -Upon termination of a process
>> -that is orphaned (i.e., its immediate parent has already terminated)
>> -and marked as having a subreaper,
>> -the nearest still living ancestor subreaper
>> -will receive a
>> +Upon termination of a process having a subreaper,
>> +all its children become orphaned
>> +and will be reparented to the nearest still living ancestor subreaper.
>> +So that on it's adopted child termination
>> +these subreaper will receive a
>> .BR SIGCHLD
>> signal and will be able to
>> .BR wait (2)
>> -on the process to discover its termination status.
>> +on the child to discover its termination status.
>> +
>> +Note, that on older kernels these prctl works slightly different.
>> +Child subreaper process was not actualy the
>> +.BR init (1)
>> +for all its descendants.
>> +If process forks a child while not been a child subreaper,
>> +and after sets himself child subreaper,
>> +sub-tree of the child might or might not reparent to the subreaper,
>> +depending on the configuration of ancestors of the subreaper,
>> +at the time of forking our subtree.
>> .TP
>> .BR PR_GET_CHILD_SUBREAPER " (since Linux 3.4)"
>> Return the "child subreaper" setting of the caller,
>> --
>> 2.9.3
>>
>
>
>
--
Best regards, Tikhomirov Pavel
Software Developer, Virtuozzo.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-28 6:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20170127100543.18390-1-ptikhomirov@virtuozzo.com>
[not found] ` <20170127100543.18390-1-ptikhomirov-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
2017-01-27 10:11 ` [PATCH] prctl.2: Document new PR_SET_CHILD_SUBREAPER semantics Pavel Tikhomirov
[not found] ` <20170127101125.18709-1-ptikhomirov-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
2017-01-27 22:47 ` Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkhg-JankZ1LNV38DHtat5HrUKKK1YO2s1figbHQ5GMhcQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-28 6:38 ` Pavel Tikhomirov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox