[Devel] [PATCH RHEL7 COMMIT] ve/net/packet: do not account sock buffer to cg if kmem acct is off

Konstantin Khorenko khorenko at virtuozzo.com
Wed Jun 17 03:53:58 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.14
------>
commit 7ec0042d2b5059c33cf803aff44c2b67f29a518f
Author: Vladimir Davydov <vdavydov at parallels.com>
Date:   Wed Jun 17 14:53:58 2015 +0400

    ve/net/packet: do not account sock buffer to cg if kmem acct is off
    
    Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 net/packet/af_packet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index b9f09eb..7cd659a 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2438,7 +2438,7 @@ static struct cg_proto *packet_sk_charge(void)
 		return ERR_PTR(-ENOMEM);
 
 	psc->memcg = try_get_mem_cgroup_from_current();
-	if (psc->memcg) {
+	if (psc->memcg && memcg_kmem_is_active(psc->memcg)) {
 		/*
 		 * Forcedly charge the maximum amount of data this socket
 		 * may have. It's typically not huge and packet sockets are



More information about the Devel mailing list