Re: [RFC][v4][PATCH 0/7] clone_with_pids() system call

From: Eric W. Biederman
Date: Wed Aug 12 2009 - 23:46:05 EST


Sukadev Bhattiprolu <sukadev@xxxxxxxxxxxxxxxxxx> writes:

> === NEW CLONE() SYSTEM CALL:
>
> To support application checkpoint/restart, a task must have the same pid it
> had when it was checkpointed. When containers are nested, the tasks within
> the containers exist in multiple pid namespaces and hence have multiple pids
> to specify during restart.
>
> This patchset implements a new system call, clone_with_pids() that lets a
> process specify the pids of the child process.
>
> Patches 1 through 5 are helpers and we believe they are needed for application
> restart, regardless of the kernel implementation of application restart.

I'm not very impressed.

- static int alloc_pidmap(struct pid_namespace *pid_ns)
+ static int alloc_pidmap(struct pid_namespace *pid_ns, int pid_max, int last_pid)

Do that.

That is pass in pid_max and last_pid, and you don't have to do weird
things in alloc_pidmap, and no set_pidmap is needed.

No changes to copy_process are needed it already takes a struct pid
argument.

I haven't been following closely what is gained by having a clone_with_pids
syscall?

As for new namespaces that don't need to happen at process creation time
(which is just about anything that is left) we can create a new syscall that
unshares just that one.


Eric
--
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/