original_kernel/net/ipv4
Eric Dumazet 0604475119 tcp: add TCPMemoryPressuresChrono counter
DRAM supply shortage and poor memory pressure tracking in TCP
stack makes any change in SO_SNDBUF/SO_RCVBUF (or equivalent autotuning
limits) and tcp_mem[] quite hazardous.

TCPMemoryPressures SNMP counter is an indication of tcp_mem sysctl
limits being hit, but only tracking number of transitions.

If TCP stack behavior under stress was perfect :
1) It would maintain memory usage close to the limit.
2) Memory pressure state would be entered for short times.

We certainly prefer 100 events lasting 10ms compared to one event
lasting 200 seconds.

This patch adds a new SNMP counter tracking cumulative duration of
memory pressure events, given in ms units.

$ cat /proc/sys/net/ipv4/tcp_mem
3088    4117    6176
$ grep TCP /proc/net/sockstat
TCP: inuse 180 orphan 0 tw 2 alloc 234 mem 4140
$ nstat -n ; sleep 10 ; nstat |grep Pressure
TcpExtTCPMemoryPressures        1700
TcpExtTCPMemoryPressuresChrono  5209

v2: Used EXPORT_SYMBOL_GPL() instead of EXPORT_SYMBOL() as David
instructed.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-08 11:26:19 -04:00
..
netfilter sk_buff: remove support for csum_bad in sk_buff 2017-05-19 19:21:29 -04:00
Kconfig
Makefile
af_inet.c net: ping: do not abuse udp_poll() 2017-06-04 22:56:55 -04:00
ah4.c ipsec: check return value of skb_to_sgvec always 2017-06-04 23:01:47 -04:00
arp.c neigh: Really delete an arp/neigh entry on "ip neigh delete" or "arp -d" 2017-06-04 21:37:18 -04:00
cipso_ipv4.c
datagram.c
devinet.c
esp4.c ipsec: check return value of skb_to_sgvec always 2017-06-04 23:01:47 -04:00
esp4_offload.c
fib_frontend.c net: lwtunnel: Add extack to encap attr validation 2017-05-30 11:55:31 -04:00
fib_lookup.h net: add extack arg to lwtunnel build state 2017-05-30 11:55:32 -04:00
fib_notifier.c
fib_rules.c
fib_semantics.c net: add extack arg to lwtunnel build state 2017-05-30 11:55:32 -04:00
fib_trie.c net: add extack arg to lwtunnel build state 2017-05-30 11:55:32 -04:00
fou.c fou: make local function static 2017-05-21 13:42:36 -04:00
gre_demux.c
gre_offload.c
icmp.c net: ipv4: refactor __ip_route_output_key_hash 2017-05-26 14:12:49 -04:00
igmp.c
inet_connection_sock.c dccp: consistently use dccp_write_space() 2017-06-04 19:58:35 -04:00
inet_diag.c
inet_fragment.c
inet_hashtables.c
inet_timewait_sock.c
inetpeer.c
ip_forward.c
ip_fragment.c
ip_gre.c
ip_input.c
ip_options.c
ip_output.c
ip_sockglue.c
ip_tunnel.c
ip_tunnel_core.c net: add extack arg to lwtunnel build state 2017-05-30 11:55:32 -04:00
ip_vti.c
ipcomp.c
ipconfig.c
ipip.c
ipmr.c
netfilter.c
ping.c
proc.c tcp: add TCPMemoryPressuresChrono counter 2017-06-08 11:26:19 -04:00
protocol.c
raw.c
raw_diag.c
route.c ipv4: route: restore skb_dst_set in inet_rtm_getroute 2017-06-01 11:30:41 -04:00
syncookies.c tcp: Namespaceify sysctl_tcp_timestamps 2017-06-08 10:53:29 -04:00
sysctl_net_ipv4.c tcp: Namespaceify sysctl_tcp_timestamps 2017-06-08 10:53:29 -04:00
tcp.c tcp: add TCPMemoryPressuresChrono counter 2017-06-08 11:26:19 -04:00
tcp_bbr.c
tcp_bic.c
tcp_cdg.c
tcp_cong.c tcp: disallow cwnd undo when switching congestion control 2017-06-02 14:18:13 -04:00
tcp_cubic.c
tcp_dctcp.c
tcp_diag.c
tcp_fastopen.c
tcp_highspeed.c
tcp_htcp.c
tcp_hybla.c
tcp_illinois.c
tcp_input.c tcp: Namespaceify sysctl_tcp_timestamps 2017-06-08 10:53:29 -04:00
tcp_ipv4.c tcp: add TCPMemoryPressuresChrono counter 2017-06-08 11:26:19 -04:00
tcp_lp.c
tcp_metrics.c
tcp_minisocks.c tcp: add a struct net parameter to tcp_parse_options() 2017-06-08 10:53:28 -04:00
tcp_nv.c tcpnv: do not export local function 2017-05-21 13:42:36 -04:00
tcp_offload.c
tcp_output.c tcp: Namespaceify sysctl_tcp_timestamps 2017-06-08 10:53:29 -04:00
tcp_probe.c
tcp_rate.c
tcp_recovery.c
tcp_scalable.c
tcp_timer.c tcp: fix TCP_SYNCNT flakes 2017-05-24 16:29:57 -04:00
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tunnel4.c
udp.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-05-18 16:11:32 -04:00
udp_diag.c
udp_impl.h udp: make *udp*_queue_rcv_skb() functions static 2017-05-18 10:23:33 -04:00
udp_offload.c
udp_tunnel.c
udplite.c
xfrm4_input.c
xfrm4_mode_beet.c
xfrm4_mode_transport.c
xfrm4_mode_tunnel.c
xfrm4_output.c
xfrm4_policy.c
xfrm4_protocol.c
xfrm4_state.c
xfrm4_tunnel.c