2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

9420 Commits

Author SHA1 Message Date
Cyrill Gorcunov
d3b4fbc2ac nmk: Gather reserved vars on top of build
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:56 +03:00
Cyrill Gorcunov
6ed2532b36 nmk: Filter out already seen targets from collect-deps
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:56 +03:00
Cyrill Gorcunov
faa8bae6f2 nmk: Don't include deps on mrproper
mrproper doesn't require inclusion of deps similar
as clean target.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:56 +03:00
Cyrill Gorcunov
314801b9f0 x86: cpu -- Drop feature bypassing
We fully support xsaves, so no need for noxsaves temporary
option anymore.

This reverts commit ba93feb5f0f017f2ee498f6ee2db58bcaf817501.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Cyrill Gorcunov
bcdbe22ab9 x86: cpu -- Allow to proceed xsaves silently
We fully support xsaves now, so no need for
warning or any other message.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Cyrill Gorcunov
7f112e6084 x86: cpu -- Make detailed verification of xsave elements in image
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Cyrill Gorcunov
9166f90e58 x86: cpu -- Calculate number of image elems runtime
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Cyrill Gorcunov
7b367a1198 compel: arm -- Remove code duplication
arm's cpu code is the same as aarch64, so use
the symlink.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Cyrill Gorcunov
d98a1eee6e compel: Shrink cpuinfo fetching
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Cyrill Gorcunov
af96768301 x86: Add prefix for logs
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Cyrill Gorcunov
373361723a x86: cpu -- Improve show_rt_xsave_frame
For debug sake

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Cyrill Gorcunov
b99be2741a x86: cpu -- Add support for extended xsave area
cpu extensions (such as avx-512) require bigger xsave
area to keep fpu registers set, so we allocate a page
per process to keep them all. On checkpoint we parse
runtime fpu features and dump them into an image and
do reverse on restore procedure.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Cyrill Gorcunov
dd4c0c6b22 compel: fpu -- Add compel_fpu_feature_offset helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Cyrill Gorcunov
d25af82cc0 compel: fpu -- Add compel_fpu_feature_size
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Cyrill Gorcunov
5014812df9 compel: fpu -- Add compel_fpu_has_feature helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Cyrill Gorcunov
888514aee0 compel: fpu -- Add compel_test_fpu_cap helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Cyrill Gorcunov
c926e2a718 x86: cpu -- Save xfeature on dump
This feature will allow to catch incapability early
if present in image.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Cyrill Gorcunov
3c4dfb6ef4 x86: cpu -- Detect and save fpu status in info
- externd compel_cpuinfo_t to keep all fpu information
   neded for xsaves mode

 - fetch xsaves data in compel_cpuid

All this will allow us to extend criu to support
avx-512 intructions.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Cyrill Gorcunov
f0fb0bc964 x86: cpu -- Add image definitions for fpu frames
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Cyrill Gorcunov
e319aaa0cf compiler: Add FIELD_SIZEOF helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Cyrill Gorcunov
bc7d57ebad log: Setup loglevel early
We're printing messages before the log file
is set up, so instead of keeping silence lets
print data in default outputs.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Andrei Vagin
6ef193b0a0 test: check criu restore with --auto-dedup
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Pawel Stradomski
9bb44e6f11 Punch holes in input files when restoring anonymous non-shared memory if --auto-dedup is enabled.
This reduces memory usage if image files are stored on tmpfs.

Signed-off-by: Pawel Stradomski <pstradomski@google.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Pavel Tikhomirov
6966309133 mount: fix segmentation fault in can_mount_now on no mnt_master
In resolve_shared_mounts there are cases when we have m->master_id > 0
but m->mnt_master is not set, it happens for cases where we have no
access to master mount, for instance CT root m->parent==NULL or when
mount is external. In can_mount_now  for such master mounts we don't
need to check mounted state also, so just use "if(mi->mnt_master)"
condition instead of "if(mi->master_id > 0)" to fix segfault.

https://jira.sw.ru/browse/PSBM-86978

Program terminated with signal 11, Segmentation fault.
0x000000000046328b in can_mount_now (mi=0x2155970) at criu/mount.c:2699
2699	list_for_each_entry(c, &mi->mnt_master->children, siblings)

(gdb) p mi->mnt_master
$2 = (struct mount_info	*) 0x0

Fixes commit 3a02362c5be1 ("mount: fix can_mount_now to wait children of
master's share properly")

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:55 +03:00
Adrian Reber
bab6c7b74b config: fix valgrind leak
Running 'criu dump -t <PID>' with a configuration file under valgrind
where <PID> does not exist, gives:

==14336== 600 bytes in 5 blocks are definitely lost in loss record 5 of 5
==14336==    at 0x4C29BC3: malloc (vg_replace_malloc.c:299)
==14336==    by 0x5D387A4: getdelim (in /usr/lib64/libc-2.17.so)
==14336==    by 0x439829: getline (stdio.h:117)
==14336==    by 0x439829: parse_config (config.c:69)
==14336==    by 0x439CB2: init_configuration.isra.1 (config.c:159)
==14336==    by 0x439F75: init_config (config.c:212)
==14336==    by 0x439F75: parse_options (config.c:487)
==14336==    by 0x42499F: main (crtools.c:140)

==14336== LEAK SUMMARY:
==14336==    definitely lost: 600 bytes in 5 blocks

With this patch:

==17892== LEAK SUMMARY:
==17892==    definitely lost: 0 bytes in 0 blocks

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Andrei Vagin
15b4d9205b test/others: check external network namespaces
Acked-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Andrei Vagin
c2b21fbf4b criu: add support for external net namespaces
It works like other external resources.
A user specify which namespaces are external and have not to be dumped.
On restore, the user gives file descriptors to preconfigured namespaces.

How to use:
dump:
        --external net[INO]:KEY
restore:
        --inherit-fd fd[NSFD]:KEY

The test script contains more details how to use this:
test/others/netns_ext/run.sh

Acked-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Andrei Vagin
3e4cecb996 net: read network namespace images before forking tasks
We need to know which namespaces are external to restore them properly.

Acked-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Pavel Tikhomirov
3a66660e3e zdtm: shared options should not be lost for bind mounts
1150 1371 0:169 / /zdtm/static/private_bind_propagation.test rw,relatime shared:920 - tmpfs zdtm_fs rw
1151 1150 0:170 / /zdtm/static/private_bind_propagation.test/share1 rw,relatime shared:921 - tmpfs share rw
1152 1150 0:170 / /zdtm/static/private_bind_propagation.test/share2 rw,relatime shared:921 - tmpfs share rw
1153 1151 0:169 /source /zdtm/static/private_bind_propagation.test/share1/child rw,relatime - tmpfs zdtm_fs rw
1154 1152 0:169 /source /zdtm/static/private_bind_propagation.test/share2/child rw,relatime - tmpfs zdtm_fs rw

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Pavel Tikhomirov
6c81e8773e zdtm.py: also check that sharing options are restored for mounts
We already check (root, mountpoint) pairs preserve, do the same for
(root, mountpoint, shared, slave) fours.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Radostin Stoyanov
868de91a09 kdat: Don't open /run/criu.kdat if doesn't exists
When CRIU is called for a first time and the /run/criu.kdat file does
not exists, the following warning is shown:
        Warn  (criu/kerndat.c:847): Can't load /run/criu.kdat

This patch is replacing this warning with a more appropriate debug message.
        File /run/criu.kdat does not exist

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Pavel Tikhomirov
e54d0d26ba mount: fix regression where open_mountpoint failed on readonly fs
If we fail to create temporary directory for doing a clean mount we can
make mount clean reusing the code which enters new mountns to umount
overmounts. As when last process exits mntns all mounts are implicitly
cleaned from children, see in kernel source - sys_exit->do_exit
->exit_task_namespaces->switch_task_namespaces->free_nsproxy
->put_mnt_ns->umount_tree->drop_collected_mounts->umount_tree:

    /* Hide the mounts from mnt_mounts */
    list_for_each_entry(p, &tmp_list, mnt_list) {
            list_del_init(&p->mnt_child);
    }

Fixes commit b6cfb1ce2948 ("mount: make open_mountpoint handle overmouts
properly")

https://github.com/checkpoint-restore/criu/issues/520
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Acked-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Pavel Tikhomirov
382756a4f5 zdtm: add a test for non-uniform shares
Create a tree of shared mounts where shared mounts have different sets
of children (while having the same root):

First share1 is mounted shared tmpfs and second share1/child1 is mounted
inside, third share1 is bind-mounted to share2 (now share1 and share2
have the same shared id, but share2 has no child), fourth share1/child2
is bind-mounted from share1, and also propagated to share2/child2 (now
all except share1/child1 have the same shared id), fifth share1/child3
is mounted and propagates inside the share.

Finally we have four mounts shared between each other with different
sets of children mounts, and even more two of them are children of
another two:

495 494 0:62 / /zdtm/static/non_uniform_share_propagation.test/share1 rw,relatime shared:235 - tmpfs share rw
496 495 0:63 / /zdtm/static/non_uniform_share_propagation.test/share1/child1 rw,relatime shared:236 - tmpfs child1 rw
497 494 0:62 / /zdtm/static/non_uniform_share_propagation.test/share2 rw,relatime shared:235 - tmpfs share rw
498 495 0:62 / /zdtm/static/non_uniform_share_propagation.test/share1/child2 rw,relatime shared:235 - tmpfs share rw
499 497 0:62 / /zdtm/static/non_uniform_share_propagation.test/share2/child2 rw,relatime shared:235 - tmpfs share rw
500 495 0:64 / /zdtm/static/non_uniform_share_propagation.test/share1/child3 rw,relatime shared:237 - tmpfs child3 rw
503 497 0:64 / /zdtm/static/non_uniform_share_propagation.test/share2/child3 rw,relatime shared:237 - tmpfs child3 rw
502 499 0:64 / /zdtm/static/non_uniform_share_propagation.test/share2/child2/child3 rw,relatime shared:237 - tmpfs child3 rw
501 498 0:64 / /zdtm/static/non_uniform_share_propagation.test/share1/child2/child3 rw,relatime shared:237 - tmpfs child3 rw

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Pavel Tikhomirov
c9cf0b4a08 mount: remove validate_shared as now we allow non-uniform sharings
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Pavel Tikhomirov
69535342cb mount: use propagation groups in propagate_mount replacing excess search
These also fixes false-propagation problem of the mount to itself if it
is in parent's share.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Pavel Tikhomirov
545b07368c mount: improve can_mount_now using propagation groups
1) redo waiting for parents of propagation group to be mounted using
pre-found propagation groups
2) for shared mount wait for children of that shared group which has no
propagation in our shared mount

(2) - effectively is a support of non-uniform shares, that means two
mounts of shared group can have different sets of children now - we will
mount them in the right order, but propagate_mount and validate_shared
are still preventing c/r-ing such shares, will fix the former and remove
the latter in separate(next) patches.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Pavel Tikhomirov
bc930d120e mount: put all mounts which propagate from each other to a list
These information will help improving the restore of tricky mounts
configurations.

Function same_propagation_group checks if two mounts were created
simultaneousely through shared mount propagation, and the main part of
these - they should be in exaclty the same place inside the share of
their parents.

Function root_path_from_parent prints the mountpoint path
relative to the root of the parent's share, by first substracting
parent's mountpoint from our mountpoint and second prepending parents
root path (relative to the root of it's file system), e.g:

id	parent_id	root	mountpoint
1	0		/	/
2	1		/	/parent_a
3	1		/dir	/parent_b
4	2		/	/parent_a/dir/a
5	3		/	/parent_b/a

(Let 2 and 3 be a shared group)

For mount 4 root_path_from_parent gives:
"/parent_a/dir/a" - "/parent_a" == "/dir/a"
"/" + "/dir/a" == "/dir/a"

For mount 5:
"/parent_b/a" - "/parent_b" == "/a"
"/dir" + "/a" == "/dir/a"

So mounts 4 and 5 are a propagation group.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Pavel Tikhomirov
24bd5fcfff zdtm: check children of shared slaves restore
495 494 0:62 / /zdtm/static/shared_slave_mount_children.test/share rw,relatime shared:235 - tmpfs share rw
496 494 0:62 / /zdtm/static/shared_slave_mount_children.test/slave1 rw,relatime shared:236 master:235 - tmpfs share rw
497 494 0:62 / /zdtm/static/shared_slave_mount_children.test/slave2 rw,relatime shared:236 master:235 - tmpfs share rw
498 496 0:63 / /zdtm/static/shared_slave_mount_children.test/slave1/child rw,relatime shared:237 - tmpfs child rw
499 497 0:63 / /zdtm/static/shared_slave_mount_children.test/slave2/child rw,relatime shared:237 - tmpfs child rw

Before the fix we had:

(00.167574)      1: Error (criu/mount.c:1769): mnt: A few mount points can't be mounted
(00.167577)      1: Error (criu/mount.c:1773): mnt: 498:496 / /tmp/.criu.mntns.o2Op5j/9-0000000000/zdtm/static/shared_slave_mount_children.test/slave1/child child
(00.167580)      1: Error (criu/mount.c:1773): mnt: 497:494 / /tmp/.criu.mntns.o2Op5j/9-0000000000/zdtm/static/shared_slave_mount_children.test/slave2 share

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Pavel Tikhomirov
64586567ae mount: fix can_mount_now to wait children of master's share properly
We should not use ->bind link for checking master's children. As if we
have two slaves shared between each other, the one mounted first will
replace ->bind link for the other - that will break restore.

Also while on it, if we do not want doubled mounts and want to
prohibit propagation to slaves on restore we likely want all children of
the whole master's share mounted before slave.

JFYI: Actually these restriction is very strict and some cases will fail
to restore, for instance (hope nobody does so):

mkdir /test
mount -t tmpfs test /test
mount --make-private /test
mkdir /test/{share,slave}
mount -t tmpfs share /test/share --make-shared
mount --bind /test/share/ /test/slave/
mount --make-slave  /test/slave
mount --make-shared /test/slave
mkdir /test/share/slave
mount --bind /test/slave/ /test/share/slave/

cat /proc/self/mountinfo | grep test
524 612 0:69 / /test rw,relatime - tmpfs test rw
570 524 0:73 / /test/share rw,relatime shared:879 - tmpfs share rw
571 524 0:73 / /test/slave rw,relatime shared:942 master:879 - tmpfs share rw
602 570 0:73 / /test/share/slave rw,relatime shared:942 master:879 - tmpfs share rw
603 571 0:73 / /test/slave/slave rw,relatime shared:943 master:942 - tmpfs share rw

Here 603 is a propagation of 602 from master 570 to slave 571, and it is
the only way to get such a mount as 571 and 602 are in one shared group
now and all later mounts to them will propagate between them and create
dublicated mounts. So to create real 603 without dups we need to have
/test/slave mounted before /test/share/slave, which contradicts with
current assumption.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Pavel Tikhomirov
fc01e18b47 zdtm: add a test for unsupported children collision
These test is not automatic as after kernel v4.11 behaviour changes, on
older kernel we get children collision:

817 188 0:48 / /zdtm/static/unsupported_children_collision.test/share1 rw,relatime shared:942 - tmpfs share rw
> 818 817 0:124 / /zdtm/static/unsupported_children_collision.test/share1/child rw,relatime shared:943 - tmpfs child1 rw
819 188 0:48 / /zdtm/static/unsupported_children_collision.test/share2 rw,relatime shared:942 - tmpfs share rw
820 819 0:125 / /zdtm/static/unsupported_children_collision.test/share2/child rw,relatime shared:944 - tmpfs child2 rw
> 821 817 0:125 / /zdtm/static/unsupported_children_collision.test/share1/child rw,relatime shared:944 - tmpfs child2 rw

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Pavel Tikhomirov
f167a1dd34 mount: add helper to check unsupported children collision
See more detailed explanation inside in-code comment.

note: Actually before we remove validate_mounts (later in these
patchset) we likely won't get to these check and fail earlier, as having
children collision implies shared mounts with different sets of
children.

note: from v4.11 and ms kernel commit 1064f874abc0 ("mnt: Tuck mounts
under others instead of creating shadow/side mounts.") there will be no
more mount collision.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Adrian Reber
35fbc373a9 test rpc: remove unnecessary import, close fd
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:54 +03:00
Cyrill Gorcunov
0a859275ef fdstore: Unlimit fdstore queue on start
We use fdstore intensively for example when handling
bindmounted sockets and ghost dgram sockets. The system
limit for per-socket queue may not be enough if someone
generate lots of ghost sockets (150 and more as been
detected on default fedora 27).

To make it operatable lets unlimit fdstore queue size
on startup.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:53 +03:00
Adrian Reber
077409c197 travis: fix rawhide test by also installing sudo
Signed-off-by: Adrian Reber <areber@redhat.com>
Acked-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Acked-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:53 +03:00
Andrei Vagin
bdbd7c8f14 zdtm/static: add a test to check epoll file descriptors
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:53 +03:00
Cyrill Gorcunov
4e8ca613d3 epoll: Use epoll queues to speedup multiple duped fds
When we are dumping epoll and one of target fd is been
duped we can reuse already collected fds rbtree to find
proper target. We handle it in a lazy way:

 - try use plain regular bsearch first, in case of all
   targets are not duped we checkpoint epoll immediately

 - if bsearch failed we put this epoll entry into a queue
   and run its dumping later when all other files in the
   process are already dumped. At this moment fds tree
   should already has all target files in rbtree thus
   we can simply lookup for it

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:53 +03:00
Cyrill Gorcunov
605b9be815 files: make_gen_id -- Promote to be general helper
It is used in files tree generation so we will need
reuse for epoll sake.

Also use the whole 64 bit offset to shuffle bits more.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:53 +03:00
Cyrill Gorcunov
67bd254a0d epoll: Add kid_lookup_epoll_tfd helper
To find target files with help of our collected
rbtree.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:53 +03:00
Cyrill Gorcunov
d026ba1cdd epoll: Exit with error if tfd is missing
If we can't find target file descriptor we should
exit on dump with error instead of skipping it.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:53 +03:00
Cyrill Gorcunov
fa989970ec epoll: Save fields of target files in eventpoll_tfd_entry
We will use them to fast lookup of targets files.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:53 +03:00