By Jonathan Corbet
November 18, 2009
Developers working to implement a checkpoint/restart capability for Linux
want the ability to create a new process with a specific process ID. In
the absence of that feature, restarted processes will suddenly find
themselves with different PIDs, which can only lead to confusion. To
implement explicit PID selection, the checkpoint/restart developers have
proposed various extensions to the
clone() system call with names
like
clone_with_pids() and
clone_extended(). No version
has yet been merged, and the proposed API continues to evolve.
The latest proposal is called eclone(); it looks like
this:
int eclone(u32 flags_low, struct clone_args *args, int args_size,
pid_t *pids);
The flags_low argument corresponds to the flags argument to
the existing clone() call, which is running out of space for new
flags. The pids argument is an optional list of PIDs to apply to
the new child process, one for each namespace in which the process
appears. Everything else goes into args:
struct clone_args {
u64 clone_flags_high;
u64 child_stack_base;
u64 child_stack_size;
u64 parent_tid_ptr;
u64 child_tid_ptr;
u32 nr_pids;
u32 reserved0;
u64 reserved1;
};
A number of these fields (child_stack_base,
child_stack_size, parent_tid_ptr, child_tid_ptr)
correspond to existing clone() arguments.
clone_flags_high allows the addition of more flags; no new flags
are defined in the eclone() proposal, though. The length of the
pids array is given by nr_pids, and the reserved
fields are there for future expansion.
Comments on the new proposal have been scarce; it may be that the
development community has gotten a little tired of seeing these patches
over and over. The silence could also mean that there are no objections to
this proposal. One big obstacle could remain to the merging of this system
call, though: it is there to support the checkpoint/restart facility, which
is definitely not ready for merging into the mainline. Getting
checkpoint/restart to a completed and maintainable state is likely to take
some time; until then, there may be reluctance to add a new system call
which does not, yet, have any real-world users.
(
Log in to post comments)