[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m1vdks2iea.fsf@fess.ebiederm.org>
Date: Thu, 13 Aug 2009 02:05:33 -0700
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
Cc: linux-kernel@...r.kernel.org, Oren Laadan <orenl@...columbia.edu>,
serue@...ibm.com, Alexey Dobriyan <adobriyan@...il.com>,
Pavel Emelyanov <xemul@...nvz.org>,
Andrew Morton <akpm@...l.org>, torvalds@...ux-foundation.org,
mikew@...gle.com, mingo@...e.hu, hpa@...or.com,
Containers <containers@...ts.linux-foundation.org>,
sukadev@...ibm.com, Oleg Nesterov <oleg@...hat.com>
Subject: Re: [RFC][v4][PATCH 0/7] clone_with_pids() system call
Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com> writes:
> Eric W. Biederman [ebiederm@...ssion.com] wrote:
> | Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com> 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.
>
> But last_pid is from the pid_ns. Do you mean to have alloc_pidmap()
> take a pid_min and pid_max and when choosing a specific pid, have
> pid_min == pid_max == target_pid ?
Yes. It already takes a pid_min and a pid_max from the environment.
I guess the pid_min is RESERVED_PIDS by default.
> | No changes to copy_process are needed it already takes a struct pid
> | argument.
>
>
> I see your point about passing in both 'struct pid*' and target_pids[].
> But in the common case the struct pid passed into copy_process() is
> NULL - allocating pid in do_fork() would significantly alter the
> existing control flow - no ? alloc_pid() assumes any new pid namespace
> has been created - in copy_namespaces(). Moving the alloc_pid() to
> do_fork() would require parsing clone_flags in do_fork() and pulling
> pid namespace code out of copy_namespaces().
Why change do_fork?
> | I haven't been following closely what is gained by having a clone_with_pids
> | syscall?
>
> When restarting an application from a checkpoint, the application must get
> the same pid it had at the time of checkpoint. clone_with_pids() would be
> used during restart so the child can be created with a specific set of pids.
That part I understand. What I don't understand is why have that one part be
special and have user space do the work?
> | 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.
> |
>
> Ok. If all new namespaces can be handled with a variant of unshare(), we can
> decouple clone_with_pids() from the clone-flags issue.
What I mean is we should be able to get away things like:
sys_new_timens();
Very very simple syscalls. One per each kind of namespace we want new
instances of.
Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists