summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2016-01-14 15:21:08 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-14 16:00:49 -0800
commitaf95d7df4059cfeab7e7c244f3564214aada7dad (patch)
tree137a733624782b600d61c0f2d995182f0c8d7dfa /net/ipv4
parent3d596f7b907b0281b997cf30c92994a71ad0a1a9 (diff)
downloadlinux-af95d7df4059cfeab7e7c244f3564214aada7dad.tar.gz
linux-af95d7df4059cfeab7e7c244f3564214aada7dad.tar.bz2
linux-af95d7df4059cfeab7e7c244f3564214aada7dad.zip
net: tcp_memcontrol: remove dead per-memcg count of allocated sockets
The number of allocated sockets is used for calculations in the soft limit phase, where packets are accepted but the socket is under memory pressure. Since there is no soft limit phase in tcp_memcontrol, and memory pressure is only entered when packets are already dropped, this is actually dead code. Remove it. As this is the last user of parent_cg_proto(), remove that too. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: David S. Miller <davem@davemloft.net> Reviewed-by: Vladimir Davydov <vdavydov@virtuozzo.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp_memcontrol.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/net/ipv4/tcp_memcontrol.c b/net/ipv4/tcp_memcontrol.c
index d07579ada001..6759e0d6bba1 100644
--- a/net/ipv4/tcp_memcontrol.c
+++ b/net/ipv4/tcp_memcontrol.c
@@ -32,7 +32,6 @@ int tcp_init_cgroup(struct mem_cgroup *memcg, struct cgroup_subsys *ss)
counter_parent = &parent_cg->memory_allocated;
page_counter_init(&cg_proto->memory_allocated, counter_parent);
- percpu_counter_init(&cg_proto->sockets_allocated, 0, GFP_KERNEL);
return 0;
}
@@ -46,8 +45,6 @@ void tcp_destroy_cgroup(struct mem_cgroup *memcg)
if (!cg_proto)
return;
- percpu_counter_destroy(&cg_proto->sockets_allocated);
-
if (cg_proto->active)
static_key_slow_dec(&memcg_socket_limit_enabled);