[Devel] [PATCH RHEL7 COMMIT] memcg: disarm memcg_socket_limit_enabled key per each active udp proto

Konstantin Khorenko khorenko at virtuozzo.com
Mon Jun 29 04:00:40 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.21
------>
commit 41d2a06dbf49a7b05d49c1922d06e26768a7bc86
Author: Vladimir Davydov <vdavydov at parallels.com>
Date:   Mon Jun 29 15:00:40 2015 +0400

    memcg: disarm memcg_socket_limit_enabled key per each active udp proto
    
    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 e7c1cd3..17552cf 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)



More information about the Devel mailing list