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

15 Commits

Author SHA1 Message Date
Pavel Emelyanov
14a7aff288 rst: Read sys.last_cap only once in kerndat
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-12 00:03:25 +04:00
Pavel Emelyanov
f0a8643736 kerndat: Initialize necessary kerndats on restore
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-11 17:38:57 +04:00
Pavel Emelyanov
461a466722 kerndat: Don't fail it tcp_*mem sysctls are missing
This can hppen if criu is run in container.

Reported-by: Frederico Araujo <araujof@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-11 17:26:34 +04:00
Cyrill Gorcunov
664659a0ad inet: tcp -- Find size of max memory allowed to restore TCP data
The maximal size which may be used in the kernel for sending TCP data
on restore is varies depending on how many memory installed on the
system, moreover the memory allocated for "read queue" is bigger than
used for "write queue". Thus when we checkpointed a big slab of data
we need to figure out which size is allowed for sending data on restore.

For this we read /proc/sys/net/ipv4/tcp_[wmem|rmem] on restore and calculate
the size needed, then we simply chop data to segements and send it
in a loop.

Typical output on restore is something like

 | (00.013001)  30110: TCP queue memory limits are 2097152:3145728

https://bugzilla.openvz.org/show_bug.cgi?id=2751

[xemul: moved stuff to kerndat.c]

Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-04 16:18:24 +04:00
Cyrill Gorcunov
9556ffb112 kerndat: Produce sane error messgaes
I've just occasionally tried to run criu on old openvz
kernel and the error message was looking somehow strange
to me

| Error (kerndat.c:39): Can't stat piggie: No such file or directory

Lets produce some more detailed error text.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-09 15:37:35 +04:00
Pavel Emelyanov
52de6313a8 kerndat: Sanitize pagemap entry read err check
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-02 09:52:22 +04:00
Pavel Emelyanov
0b5170c0fc mem: Remove pagemap2 mentions
This file was created for backward compatibility with
not-yet-patched kernel. Now we can remove it.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-02 09:51:33 +04:00
Pavel Emelyanov
0f96026192 mem: Lower messages severity for inability to reset dirty tracker
The _actual_ need for this is checked in other place.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-02 09:15:50 +04:00
Cyrill Gorcunov
58cb8b2769 pagemap: Move PME_ constants to the header
This constants are system wide, so move them to mem.h
header for reuse sake.

[ xemul: It was kerndat.h in the patch ]

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-23 12:50:43 +04:00
Pavel Emelyanov
61c6360c1d mem: Update soft-dirty detection to work on -mm tree
The soft-dirty API has changed slightly -- now the bit in
question _is_ in pagemap file (not pagemap2) but to see it
we have to reset soft-dirty for anyone first.

Teach the kerndat soft-dirty checker this fact. The actual
pagemap reading code already knows select pagemap/pagemap2
file itself.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-17 16:13:49 +04:00
Libo Chen
076ad01e4c kerndat: munmap when stat call fail
Avoid memleak in err case

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-04 22:03:08 +04:00
Pavel Emelyanov
a3872dbead mem: Treat /proc/pid/pagemap2 file as optional
It will appear not earlier than in 3.10.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-23 23:22:25 +04:00
Libo Chen
9f9ed0c69e kerndat:fix compile err
Update to commit 78b8abe9a53884686d4f70d1376f85108cbfc857
I find a compile err:

kerndat.c: In function 'kerndat_get_dirty_track':
kerndat.c:78:6: error: ignoring return value of 'read', declared with attribute warn_unused_result [-Werror=unused-result]
cc1: all warnings being treated as errors
make[2]: *** [kerndat.o] Error 1
make[1]: *** [built-in.o] Error 2
make[1]: Leaving directory `/home/clb/crtools'
make: *** [all] Error 2

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-16 21:51:27 +04:00
Pavel Emelyanov
199dba2361 soft-dirty: Check that kernel reports soft-dirty bits
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-15 13:24:32 +04:00
Pavel Emelyanov
5b343b40eb kerndat: Introduce the storage of kernel run-time info
One of such things we use right now is the device for anon shmem
mappings backing. In the furure this can be extended to check for
various kernel features.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-15 13:02:09 +04:00