Re: [RFC][PATCH 0/3] fork: Add the ability to create taskswith?given pids

From: Oleg Nesterov
Date: Sun Nov 27 2011 - 11:32:44 EST


On 11/25, Pedro Alves wrote:
>
> From the perspective of a client that is
> going to use this on a live system, CLONE_CHILD_USEPIDS seems a little better,
> in that the pid race is only against another task reusing the same pid,

Yes. Except you can't use on a live system at all. It simply doesn't
work after the first "normal" clone() without CLONE_CHILD_USEPIDS.

Although we can probably allow CLONE_CHILD_USEPIDS for CAP_SYS_ADMIN.

> while with setting last_pid, you have a try/whoops-not-the-pid-I-want/kill/retry/rinse/repeat/
> loop racing against all fork/clone's in the system,

Yes, setting last_pid can race with another fork(). I agree this
sucks. But simple ;)

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/