diff options
author | Andrew Vagin <avagin@openvz.org> | 2015-10-27 18:00:00 +0300 |
---|---|---|
committer | Pavel Emelyanov <xemul@parallels.com> | 2015-10-28 10:23:23 +0300 |
commit | a0e835fa1bdebf6d63f2f289c28af3d4ba578b3a (patch) | |
tree | 9b2d7639be5bc2cd34a2ed2e6225db3705037ce3 | |
parent | 2467a30fe29a54a6e382c139301de0cd4a8961eb (diff) |
socket: values of snd and rcv buffer should be divide into two
This values will be doubled in kernel to account for
"struct sk_buff" etc. overhead.
Currently criu restores snd and rcv buffer limits incorrectly,
they become bigger on each iteration.
$ ../crit show dump/zdtm/live/static/socket-tcp/6299/1/inetsk.img | grep buf
"so_sndbuf": 2626560,
"so_rcvbuf": 1060720,
"so_sndbuf": 16384,
"so_rcvbuf": 87380,
$ ../crit show dump/zdtm/live/static/socket-tcp/6299/2/inetsk.img | grep buf
"so_sndbuf": 5253120,
"so_rcvbuf": 2121440,
"so_sndbuf": 32768,
"so_rcvbuf": 174760,
$ ../crit show dump/zdtm/live/static/socket-tcp/6299/3/inetsk.img | grep buf
"so_sndbuf": 10506240,
"so_rcvbuf": 4242880,
"so_sndbuf": 65536,
"so_rcvbuf": 349520,
With-help-of: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
-rw-r--r-- | sockets.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -419,7 +419,8 @@ int restore_socket_opts(int sk, SkOptsEntry *soe) { int ret = 0, val; struct timeval tv; - u32 bufs[2] = { soe->so_sndbuf, soe->so_rcvbuf }; + /* In kernel a bufsize value is doubled. */ + u32 bufs[2] = { soe->so_sndbuf / 2, soe->so_rcvbuf / 2}; pr_info("%d restore sndbuf %d rcv buf %d\n", sk, soe->so_sndbuf, soe->so_rcvbuf); |