[PATCH] Add a choosepid() syscall as a simpler alternative to clone_with_pids()

Oren Laadan orenl at librato.com
Mon Nov 2 12:48:59 PST 2009


Hi Dan,

Two comments:

1. We already tried a similar approach over a year ago - selecting pids
using a /proc interface instead of a dedicated syscall - and received
chilling reactions. (IIRC posted by Nadia Derbey).

2. What do you expect to gain by splitting the work into two separate
system calls ?

Oren.


Dan Smith wrote:
> This proposed simpler interface builds on all the real work done by Suka's
> early patches in his clone3() set.  Instead of passing in the pids we want
> in the clone3() call itself, this interface lets us build that list ahead
> of time, to be used on the next regular clone().
> 
> Some points about the implementation:
>  - The first call to choosepid() allocates a pid_t array on current
>  - All pids in that list start as zero, which do_fork_with_pids treats as
>    undefined
>  - A call to clone() or exec() always clears the current set of next pids
>  - This was Serge's idea, based on a permutation of Daniel Lezcano's
>    cloneat() suggestion
>  - This is based on all Suka's hard work, with a trivial change to the
>    do_fork_with_pids() function to eliminate the copy_from_user() of the
>    pid_t list
> 
> Signed-off-by: Dan Smith <danms at us.ibm.com>
> Acked-by: Serge Hallyn <serue at us.ibm.com>

[...]



More information about the Containers mailing list