diff options
author | Eric Dumazet <edumazet@google.com> | 2019-06-14 16:22:19 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-14 20:18:28 -0700 |
commit | ede61ca474a0348b975d9824565b66c7595461de (patch) | |
tree | bc0770bb86ede5aed3f91f68773e412ee1067d07 /net/ipv4 | |
parent | a8e11e5c5611a9f70470aebeb2c1dd6132f609d7 (diff) | |
download | linux-stable-ede61ca474a0348b975d9824565b66c7595461de.tar.gz linux-stable-ede61ca474a0348b975d9824565b66c7595461de.tar.bz2 linux-stable-ede61ca474a0348b975d9824565b66c7595461de.zip |
tcp: add tcp_rx_skb_cache sysctl
Instead of relying on rps_needed, it is safer to use a separate
static key, since we do not want to enable TCP rx_skb_cache
by default. This feature can cause huge increase of memory
usage on hosts with millions of sockets.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/sysctl_net_ipv4.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index 875867b64d6a..886b58d31351 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c @@ -51,6 +51,9 @@ static int comp_sack_nr_max = 255; static u32 u32_max_div_HZ = UINT_MAX / HZ; static int one_day_secs = 24 * 3600; +DEFINE_STATIC_KEY_FALSE(tcp_rx_skb_cache_key); +EXPORT_SYMBOL(tcp_rx_skb_cache_key); + /* obsolete */ static int sysctl_tcp_low_latency __read_mostly; @@ -559,6 +562,12 @@ static struct ctl_table ipv4_table[] = { .extra1 = &sysctl_fib_sync_mem_min, .extra2 = &sysctl_fib_sync_mem_max, }, + { + .procname = "tcp_rx_skb_cache", + .data = &tcp_rx_skb_cache_key.key, + .mode = 0644, + .proc_handler = proc_do_static_key, + }, { } }; |