[Devel] Re: External checkpoint patch

Cedric Le Goater clg at fr.ibm.com
Thu Oct 23 06:48:22 PDT 2008


Oren Laadan wrote:
>> Oren,
>>
>> Could you take a look over Cedric's external checkpoint patch?
>>
>> http://git.kernel.org/?p=linux/kernel/git/daveh/linux-2.6-cr.git;a=commit;h=28ffabbc17d3641eee2a7eb66f714c266c400263
>>
>> It seems pretty small to me.
>>
>> --
> 
> I committed a couple of patches on top of ckpt-v7 that do this.
> (the first one is actually a simple cleanup that is unrelated).
> 
> see:
> http://git.ncl.cs.columbia.edu/?p=linux-cr-dev.git;a=shortlog;h=refs/heads/ckpt-v7
> (or git://git.ncl.cs.columbia.edu/pub/git/linux-cr-dev.git ckpt-v7)
> 
> *  "Minor simplification of cr_ctx_alloc(), cr_ctx_free()"
> *  "External checkpoint of a task other than ourself"
> 
> To checkpoint another task, you need to freeze that other task, or to
> SIGSTOP it (if using a kernel without freezer cgroup).
> 
> Restart remains the same except the the original PID is not preserved
> (because we haven't solved yet the fork-with-specific-pid issue).
> 
> In reality, you would create a new names space, and have the task running
> in there call 'sys_restart()'.
> 
> Below are test1.c, ckpt.c (to checkpoint), and rstr.c (to restart), as
> well as the two patches.
> 
> I tested it this way:
> 	$ ./test.1 &
> 	[1] 3493
> 
> 	$ kill -STOP 3493
> 	$ ./ckpt 3493 > ckpt.image
> 	
> 	$ mv /tmp/cr-test.out /tmp/cr-test.out.orig
> 	$ cp /tmp/cr-test.out.orig /tmp/cr-test.out
> 
> 	$ kill -CONT 3493
> 
> 	$ ./rstr < ckpt.image
> now compare the output of the two output files


Oren, 

I've merged your v7 patches on top of the 2.6.27-lxc3 patchset : 

	http://lxc.sourceforge.net/patches/2.6.27/2.6.27-lxc3/

the -lxc patchset includes the just merged freezer and sysfs patches
required for the netns. 

the lxc user tools using the patchset are here (CVS head for the 
moment) : 

	 http://sourceforge.net/projects/lxc/

simple applications calculating decimals of PI (source attached) are 
successfully checkpointed and restarted with the lxc-checkpoint and 
lxc-restart tools. something like the following :

	$ lxc-create -n foo 
	$ lxc-start -n foo ./pi1 40000 &
	$ lxc-checkpoint -n foo > /tmp/statefile
	$ lxc-restart -n foo < /tmp/statefile

stdin should be closed of course and all output redirected to a regular 
file.

This is work in progress of course but it's a major milestone !

Thanks,

C.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pi1.c
Type: text/x-csrc
Size: 4439 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/devel/attachments/20081023/7e13a04c/attachment-0001.bin>
-------------- next part --------------
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers


More information about the Devel mailing list