]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/net/tcp.h
Merge tag 'for-4.5' of git://git.osdn.jp/gitroot/uclinux-h8/linux
[karo-tx-linux.git] / include / net / tcp.h
index 0646521400bfabf9d083ccf423958ead56dcfb8f..8ea19977ea530bffb57bebed734b977c95b603c5 100644 (file)
@@ -240,7 +240,6 @@ extern int sysctl_tcp_timestamps;
 extern int sysctl_tcp_window_scaling;
 extern int sysctl_tcp_sack;
 extern int sysctl_tcp_fin_timeout;
-extern int sysctl_tcp_keepalive_intvl;
 extern int sysctl_tcp_syn_retries;
 extern int sysctl_tcp_synack_retries;
 extern int sysctl_tcp_retries1;
@@ -290,8 +289,9 @@ extern int tcp_memory_pressure;
 /* optimized version of sk_under_memory_pressure() for TCP sockets */
 static inline bool tcp_under_memory_pressure(const struct sock *sk)
 {
-       if (mem_cgroup_sockets_enabled && sk->sk_cgrp)
-               return !!sk->sk_cgrp->memory_pressure;
+       if (mem_cgroup_sockets_enabled && sk->sk_memcg &&
+           mem_cgroup_under_socket_pressure(sk->sk_memcg))
+               return true;
 
        return tcp_memory_pressure;
 }
@@ -1223,7 +1223,9 @@ void tcp_enter_memory_pressure(struct sock *sk);
 
 static inline int keepalive_intvl_when(const struct tcp_sock *tp)
 {
-       return tp->keepalive_intvl ? : sysctl_tcp_keepalive_intvl;
+       struct net *net = sock_net((struct sock *)tp);
+
+       return tp->keepalive_intvl ? : net->ipv4.sysctl_tcp_keepalive_intvl;
 }
 
 static inline int keepalive_time_when(const struct tcp_sock *tp)