Re: [Ksummit-2010-discuss] checkpoint-restart: naked patch

From: Sukadev Bhattiprolu
Date: Fri Nov 05 2010 - 13:31:26 EST


On Thu, Nov 4, 2010 at 8:55 PM, Kapil Arya <kapil@xxxxxxxxxxx> wrote:

>> * Complexity: they technically implement a virtual pid-namespace in userspace
>> by intercepting calls to clone(). I wonder if they consider e.g. pid's saved
>> on file owners or in afunix creds ? I'll just say it's nearly impossible with
>> their 20K lines of code - I know because I did it in a kernel module ...
>
> We do wrap clone and create a table from original PID/TID to current PID/TID
> just as you say. To our knowledge, we have wrappers for all system calls
> involving a PID/TID except fcntl. We are guessing that either Linux C/R also
> keeps a translation table or else restores the original PID/TID. Which do you
> do? In the latter case what do you do if a PID/TID is already used by another
> process/thread?
>

Like Oren said, we run the application inside the container - which would have
its own pid namespace. When we restart, we again create a container, which
starts with a fresh pid namespace, so the pids will not be in use.
IOW, a process
has a virtual pid and a global pid. The virtual pid is what the
application sees
when it calls getpid() and that pid will be correctly restored when you create
the container.

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