Re: [PATCH v4 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-11 Thread Adrian Reber
On Sun, Aug 11, 2019 at 09:06:59PM +0200, Christian Brauner wrote: > On Sun, Aug 11, 2019 at 08:51:48AM +0200, Christian Brauner wrote: > > On Sat, Aug 10, 2019 at 07:59:18AM +0200, Adrian Reber wrote: > > > On Sat, Aug 10, 2019 at 03:10:34AM +0200, Christian Brauner wrote: > > > > On Thu, Aug 08,

Re: [PATCH v4 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-11 Thread Christian Brauner
On Sun, Aug 11, 2019 at 08:51:48AM +0200, Christian Brauner wrote: > On Sat, Aug 10, 2019 at 07:59:18AM +0200, Adrian Reber wrote: > > On Sat, Aug 10, 2019 at 03:10:34AM +0200, Christian Brauner wrote: > > > On Thu, Aug 08, 2019 at 11:22:21PM +0200, Adrian Reber wrote: > > > > The main motivation t

Re: [PATCH v4 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-10 Thread Christian Brauner
On Sat, Aug 10, 2019 at 07:59:18AM +0200, Adrian Reber wrote: > On Sat, Aug 10, 2019 at 03:10:34AM +0200, Christian Brauner wrote: > > On Thu, Aug 08, 2019 at 11:22:21PM +0200, Adrian Reber wrote: > > > The main motivation to add set_tid to clone3() is CRIU. > > > > > > To restore a process with t

Re: [PATCH v4 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-09 Thread Adrian Reber
On Sat, Aug 10, 2019 at 03:10:34AM +0200, Christian Brauner wrote: > On Thu, Aug 08, 2019 at 11:22:21PM +0200, Adrian Reber wrote: > > The main motivation to add set_tid to clone3() is CRIU. > > > > To restore a process with the same PID/TID CRIU currently uses > > /proc/sys/kernel/ns_last_pid. It

Re: [PATCH v4 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-09 Thread Christian Brauner
On Thu, Aug 08, 2019 at 11:22:21PM +0200, Adrian Reber wrote: > The main motivation to add set_tid to clone3() is CRIU. > > To restore a process with the same PID/TID CRIU currently uses > /proc/sys/kernel/ns_last_pid. It writes the desired (PID - 1) to > ns_last_pid and then (quickly) does a clon

[PATCH v4 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-08 Thread Adrian Reber
The main motivation to add set_tid to clone3() is CRIU. To restore a process with the same PID/TID CRIU currently uses /proc/sys/kernel/ns_last_pid. It writes the desired (PID - 1) to ns_last_pid and then (quickly) does a clone(). This works most of the time, but it is racy. It is also slow as it