diff options
| author | Glauber Costa <[email protected]> | 2011-12-11 21:47:04 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2011-12-13 00:04:10 +0000 |
| commit | d1a4c0b37c296e600ffe08edb0db2dc1b8f550d7 (patch) | |
| tree | 5c3675582cbbdc99f720aa1dcc1821e26c2be1ab /net/ipv6/tcp_ipv6.c | |
| parent | socket: initial cgroup code. (diff) | |
| download | kernel-d1a4c0b37c296e600ffe08edb0db2dc1b8f550d7.tar.gz kernel-d1a4c0b37c296e600ffe08edb0db2dc1b8f550d7.zip | |
tcp memory pressure controls
This patch introduces memory pressure controls for the tcp
protocol. It uses the generic socket memory pressure code
introduced in earlier patches, and fills in the
necessary data in cg_proto struct.
Signed-off-by: Glauber Costa <[email protected]>
Reviewed-by: KAMEZAWA Hiroyuki <[email protected]>
CC: Eric W. Biederman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
| -rw-r--r-- | net/ipv6/tcp_ipv6.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index b69c7030aba9..95d3cfb65d39 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -62,6 +62,7 @@ #include <net/netdma.h> #include <net/inet_common.h> #include <net/secure_seq.h> +#include <net/tcp_memcontrol.h> #include <asm/uaccess.h> @@ -1994,6 +1995,7 @@ static int tcp_v6_init_sock(struct sock *sk) sk->sk_rcvbuf = sysctl_tcp_rmem[1]; local_bh_disable(); + sock_update_memcg(sk); sk_sockets_allocated_inc(sk); local_bh_enable(); @@ -2227,6 +2229,9 @@ struct proto tcpv6_prot = { .compat_setsockopt = compat_tcp_setsockopt, .compat_getsockopt = compat_tcp_getsockopt, #endif +#ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM + .proto_cgroup = tcp_proto_cgroup, +#endif }; static const struct inet6_protocol tcpv6_protocol = { |
