[CRIU] How should pre-dump work?

Michael Holzheu holzheu at linux.vnet.ibm.com
Tue Jul 18 15:59:40 MSK 2017


According to https://criu.org/Iterative_migration I tested the
CRIU pre-dump feature.

I did the following steps:

1) Compile test program that fills 512MB memory
-----------------------------------------------

~# cat predump_test.c 
#include <stdio.h>
#include <string.h>
#include <unistd.h>

/* Define 512 MB buffer */
char buf[(1 << 20) * 512];

int main(void)
{
        /* Fill buffer */
        memset(buf, 1, sizeof(buf));
        /* Loop */
        while (1) {
                fprintf(stderr, ".");
                sleep(5);
        }
        return 0;
}

~# gcc -o predump_test predump_test.c
~# ./predump_test

~# mkdir A B C

2) Do 1st pre-dump
------------------

# criu pre-dump -t $(pgrep predump_test) --shell-job --images-dir A/

root at r3545010~# du -h A/*
4.0K    A/irmap-cache
8.0K    A/pagemap-27013.img
513M    A/pages-1.img
4.0K    A/stats-dump

We get the expected 513 MB "pages-1.img" file.

3) Do 2nd pre-dump
------------------

~# criu pre-dump -t $(pgrep predump_test) --shell-job --images-dir B/ --prev-images-dir ../A

~# du -h B/*
4.0K    B/irmap-cache
4.0K    B/pagemap-27013.img
24K     B/pages-1.img
0       B/parent
4.0K    B/stats-dump

As expected the "pages-1.img" file is small.

4) Do final dump
----------------

~# criu dump -t $(pgrep predump_test) --shell-job --images-dir C/ --prev-images-dir ../B

~# du -h C/*
8.0K    C/cgroup.img
4.0K    C/core-27013.img
4.0K    C/fdinfo-2.img
4.0K    C/files.img
4.0K    C/fs-27013.img
4.0K    C/ids-27013.img
4.0K    C/inventory.img
4.0K    C/mm-27013.img
8.0K    C/pagemap-27013.img
513M    C/pages-1.img
0       C/parent
4.0K    C/pstree.img
4.0K    C/stats-dump
4.0K    C/tty-info.img
4.0K    C/tty.img

We get again a 513 MB "pages-1.img" file - why?

I get the same results on s390 and on x86.

System information
------------------
CRIU git version: 1f734612779d076d597dadbbf4ef9256c89d1241 (criu-dev)
CRIU version    : Version: 3.2
Distro version  : VERSION="16.04.1 LTS (Xenial Xerus)"
Kernel version  : Linux r3545010 4.8.0-34-generic #36~16.04.1-Ubuntu SMP Wed Dec 21 19:00:07 UTC 2016 s390x s390x

Best Regards,
Michael



More information about the CRIU mailing list