mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
When one sets socket buffer sizes with setsockopt(SO_{SND,RCV}BUF*),
kernel sets coresponding SOCK_SNDBUF_LOCK or SOCK_RCVBUF_LOCK flags on
struct sock. It means that such a socket with explicitly changed buffer
size can not be auto-adjusted by kernel (e.g. if there is free memory
kernel can auto-increase default socket buffers to improve perfomance).
(see tcp_fixup_rcvbuf() and tcp_sndbuf_expand())
CRIU is always changing buf sizes on restore, that means that all
sockets receive lock flags on struct sock and become non-auto-adjusted
after migration. In some cases it can decrease perfomance of network
connections quite a lot.
So let's c/r socket buf locks (SO_BUF_LOCKS), so that sockets for which
auto-adjustment is available does not lose it.
Reviewed-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
43 lines
1 KiB
Protocol Buffer
43 lines
1 KiB
Protocol Buffer
// SPDX-License-Identifier: MIT
|
|
|
|
syntax = "proto2";
|
|
|
|
message sk_opts_entry {
|
|
required uint32 so_sndbuf = 1;
|
|
required uint32 so_rcvbuf = 2;
|
|
|
|
required uint64 so_snd_tmo_sec = 3;
|
|
required uint64 so_snd_tmo_usec = 4;
|
|
required uint64 so_rcv_tmo_sec = 5;
|
|
required uint64 so_rcv_tmo_usec = 6;
|
|
optional bool reuseaddr = 7;
|
|
|
|
optional uint32 so_priority = 8;
|
|
optional uint32 so_rcvlowat = 9;
|
|
optional uint32 so_mark = 10;
|
|
optional bool so_passcred = 11;
|
|
optional bool so_passsec = 12;
|
|
optional bool so_dontroute = 13;
|
|
optional bool so_no_check = 14;
|
|
|
|
optional string so_bound_dev = 15;
|
|
|
|
repeated fixed64 so_filter = 16;
|
|
optional bool so_reuseport = 17;
|
|
optional bool so_broadcast = 18;
|
|
optional bool so_keepalive = 19;
|
|
optional uint32 tcp_keepcnt = 20;
|
|
optional uint32 tcp_keepidle = 21;
|
|
optional uint32 tcp_keepintvl = 22;
|
|
optional uint32 so_oobinline = 23;
|
|
optional uint32 so_linger = 24;
|
|
|
|
optional uint32 so_buf_lock = 25;
|
|
}
|
|
|
|
enum sk_shutdown {
|
|
NONE = 0;
|
|
READ = 1;
|
|
WRITE = 2;
|
|
BOTH = 3;
|
|
}
|