Commit 6d9507f4 authored by Pavel Emelyanov's avatar Pavel Emelyanov

kdat: Remove tcp_max_rshare

TCP code doesn't need one any longer.
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent d5a7a1cb
......@@ -25,7 +25,6 @@ enum pagemap_func {
struct kerndat_s {
dev_t shmem_dev;
int tcp_max_rshare;
int last_cap;
u64 zero_page_pfn;
bool has_dirty_track;
......
......@@ -24,23 +24,6 @@
#include "syscall-codes.h"
struct kerndat_s kdat = {
/*
* TCP send receive buffers are calculated
* dynamically by the kernel taking into account
* the size of memory present on the machine.
*
* On machines with huge amount of memory it grants
* up to 4M for sendding buffer and 6M for receiving.
* But in turn for low mem machines these limits
* are quite small down to 16K for sending and
* 87380 for receiving.
*
* We will find out precise limits in tcp_read_sysctl_limits
* but by default lets stick for small data to not fail
* on restore: better to slowdown restore procedure than
* failing completely.
*/
.tcp_max_rshare = 87380,
};
static int check_pagemap(void)
......@@ -305,44 +288,6 @@ no_dt:
return 0;
}
/*
* Strictly speaking, if there is a machine with huge amount
* of memory, we're allowed to send up to 4M and read up to
* 6M of tcp data at once. But we will figure out precise size
* of a limit a bit later when restore starts.
*
* Meanwhile set it up to 2M and 3M, which is safe enough to
* proceed without errors.
*/
static int tcp_read_sysctl_limits(void)
{
u32 vect[3] = { };
int ret;
struct sysctl_req req[] = {
{ "net/ipv4/tcp_rmem", &vect, CTL_U32A(ARRAY_SIZE(vect)), CTL_FLAGS_OPTIONAL },
};
/*
* Lets figure out which exactly amount of memory is
* availabe for send/read queues on restore.
*/
ret = sysctl_op(req, ARRAY_SIZE(req), CTL_READ, 0);
if (ret || vect[0] == 0) {
pr_warn("TCP mem sysctls are not available. Using defaults.\n");
goto out;
}
kdat.tcp_max_rshare = min(kdat.tcp_max_rshare, (int)vect[2]);
if (kdat.tcp_max_rshare < 128)
pr_warn("The memory limits for TCP queues are suspiciously small\n");
out:
pr_debug("TCP recv queue memory limit is %d\n", kdat.tcp_max_rshare);
return 0;
}
/* The page frame number (PFN) is constant for the zero page */
static int init_zero_page_pfn()
{
......@@ -538,8 +483,6 @@ int kerndat_init_rst(void)
*/
ret = check_pagemap();
if (!ret)
ret = tcp_read_sysctl_limits();
if (!ret)
ret = get_last_cap();
if (!ret)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment