diff options
author | Vladimir Davydov <vdavydov@parallels.com> | 2015-02-12 17:59:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-12 21:54:10 -0500 |
commit | f48b80a5e22200347e91f96b8b237b24b93c7192 (patch) | |
tree | d28d2e0915a135cb2cecc3dd144e99d98327b37c /net/ipv4 | |
parent | 932ff6bbbdcadd85b309ef4fd59d4d8a77329b8b (diff) |
memcg: cleanup static keys decrement
Move memcg_socket_limit_enabled decrement to tcp_destroy_cgroup (called
from memcg_destroy_kmem -> mem_cgroup_sockets_destroy) and zap a bunch of
wrapper functions.
Although this patch moves static keys decrement from __mem_cgroup_free to
mem_cgroup_css_free, it does not introduce any functional changes, because
the keys are incremented on setting the limit (tcp or kmem), which can
only happen after successful mem_cgroup_css_online.
Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Cc: Glauber Costa <glommer@parallels.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujtisu.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
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.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv4/tcp_memcontrol.c b/net/ipv4/tcp_memcontrol.c index c2a75c6957a1..2379c1b4efb2 100644 --- a/net/ipv4/tcp_memcontrol.c +++ b/net/ipv4/tcp_memcontrol.c | |||
@@ -47,6 +47,10 @@ void tcp_destroy_cgroup(struct mem_cgroup *memcg) | |||
47 | return; | 47 | return; |
48 | 48 | ||
49 | percpu_counter_destroy(&cg_proto->sockets_allocated); | 49 | percpu_counter_destroy(&cg_proto->sockets_allocated); |
50 | |||
51 | if (test_bit(MEMCG_SOCK_ACTIVATED, &cg_proto->flags)) | ||
52 | static_key_slow_dec(&memcg_socket_limit_enabled); | ||
53 | |||
50 | } | 54 | } |
51 | EXPORT_SYMBOL(tcp_destroy_cgroup); | 55 | EXPORT_SYMBOL(tcp_destroy_cgroup); |
52 | 56 | ||