tcp buffer limitation: per-cgroup limit
authorGlauber Costa <glommer@parallels.com>
Sun, 11 Dec 2011 21:47:06 +0000 (21:47 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Dec 2011 00:04:11 +0000 (19:04 -0500)
commit3aaabe2342c36bf48567b88fa78b819eee14bb5e
tree1364c84c53ba6382f9a9df9d6f42a3bc37427d05
parent3dc43e3e4d0b52197d3205214fe8f162f9e0c334
tcp buffer limitation: per-cgroup limit

This patch uses the "tcp.limit_in_bytes" field of the kmem_cgroup to
effectively control the amount of kernel memory pinned by a cgroup.

This value is ignored in the root cgroup, and in all others,
caps the value specified by the admin in the net namespaces'
view of tcp_sysctl_mem.

If namespaces are being used, the admin is allowed to set a
value bigger than cgroup's maximum, the same way it is allowed
to set pretty much unlimited values in a real box.

Signed-off-by: Glauber Costa <glommer@parallels.com>
Reviewed-by: Hiroyouki Kamezawa <kamezawa.hiroyu@jp.fujitsu.com>
CC: David S. Miller <davem@davemloft.net>
CC: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/cgroups/memory.txt
include/net/tcp_memcontrol.h
net/ipv4/sysctl_net_ipv4.c
net/ipv4/tcp_memcontrol.c