[Devel] [PATCH rh7 3/4] memcg: disarm memcg_socket_limit_enabled key per each active udp proto

Vladimir Davydov vdavydov at parallels.com
Thu Jun 25 09:08:24 PDT 2015


We increment it not only per each active tcp proto, but also per each
active udp proto - see udp_memcontrol.c, so we must decrement it
appropriately when a proto is destroyed.

Fixes: bf083721b986e ("udp: Charge ingress buffers into cg memory")
Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 mm/memcontrol.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index e7c1cd381ab3..17552cfbf4a1 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -584,9 +584,10 @@ EXPORT_SYMBOL(udp_proto_cgroup);
 
 static void disarm_sock_keys(struct mem_cgroup *memcg)
 {
-	if (!memcg_proto_activated(&memcg->tcp_mem.cg_proto))
-		return;
-	static_key_slow_dec(&memcg_socket_limit_enabled);
+	if (memcg_proto_activated(&memcg->tcp_mem.cg_proto))
+		static_key_slow_dec(&memcg_socket_limit_enabled);
+	if (memcg_proto_activated(&memcg->udp_mem.cg_proto))
+		static_key_slow_dec(&memcg_socket_limit_enabled);
 }
 #else
 static void disarm_sock_keys(struct mem_cgroup *memcg)
-- 
2.1.4




More information about the Devel mailing list