[Devel] [PATCH RHEL7 COMMIT] ub: remove sock acct related resources from cgroup params

Konstantin Khorenko khorenko at virtuozzo.com
Mon Jun 29 06:53:57 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.22
------>
commit da2ff85105421a5a8cbecf1e38e57b6e6ccf80cc
Author: Vladimir Davydov <vdavydov at parallels.com>
Date:   Mon Jun 29 17:53:57 2015 +0400

    ub: remove sock acct related resources from cgroup params
    
    These resources are now accounted by memcg, so hide them, just like we
    do for other such resources.
    
    Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 kernel/bc/beancounter.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/kernel/bc/beancounter.c b/kernel/bc/beancounter.c
index 5f1affa..6b5ed78 100644
--- a/kernel/bc/beancounter.c
+++ b/kernel/bc/beancounter.c
@@ -483,6 +483,12 @@ static inline int bc_verify_held(struct user_beancounter *ub)
 	ub->ub_parms[UB_PHYSPAGES].held = 0;
 	ub->ub_parms[UB_SWAPPAGES].held = 0;
 	ub->ub_parms[UB_OOMGUARPAGES].held = 0;
+	ub->ub_parms[UB_NUMTCPSOCK].held = 0;
+	ub->ub_parms[UB_TCPSNDBUF].held = 0;
+	ub->ub_parms[UB_TCPRCVBUF].held = 0;
+	ub->ub_parms[UB_OTHERSOCKBUF].held = 0;
+	ub->ub_parms[UB_DGRAMRCVBUF].held = 0;
+	ub->ub_parms[UB_NUMOTHERSOCK].held = 0;
 
 	clean = 1;
 	for (i = 0; i < UB_RESOURCES; i++)
@@ -783,12 +789,20 @@ static __init int ub_cgroup_init(void)
 			continue;
 
 		/* accounted by memcg */
-		if (i == UB_PHYSPAGES ||
-		    i == UB_SWAPPAGES ||
-		    i == UB_OOMGUARPAGES ||
-		    i == UB_KMEMSIZE ||
-		    i == UB_DCACHESIZE)
+		switch (i) {
+		case UB_KMEMSIZE:
+		case UB_DCACHESIZE:
+		case UB_PHYSPAGES:
+		case UB_SWAPPAGES:
+		case UB_OOMGUARPAGES:
+		case UB_NUMTCPSOCK:
+		case UB_TCPSNDBUF:
+		case UB_TCPRCVBUF:
+		case UB_OTHERSOCKBUF:
+		case UB_DGRAMRCVBUF:
+		case UB_NUMOTHERSOCK:
 			continue;
+		}
 
 		cft = &cgroup_files[j * UB_CGROUP_NR_ATTRS];
 		snprintf(cft->name, MAX_CFTYPE_NAME, "%s.held", ub_rnames[i]);



More information about the Devel mailing list