[Devel] [PATCH vz8 2/4] Revert "ve/bc/resources: get number of processes from pids cgroup"

Andrey Ryabinin aryabinin at virtuozzo.com
Tue Apr 28 18:32:50 MSK 2020


This reverts commit 2c5a80f15cb83b48d7193f862a50da215203e134.

This needed only for /proc/bc/resources which is going to be elimented.

https://jira.sw.ru/browse/PSBM-80807
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 kernel/cgroup/pids.c     | 33 ---------------------------------
 kernel/ve/bc/resources.c |  3 ---
 2 files changed, 36 deletions(-)

diff --git a/kernel/cgroup/pids.c b/kernel/cgroup/pids.c
index b2530c8041f8..9829c67ebc0a 100644
--- a/kernel/cgroup/pids.c
+++ b/kernel/cgroup/pids.c
@@ -347,36 +347,3 @@ struct cgroup_subsys pids_cgrp_subsys = {
 	.dfl_cftypes	= pids_files,
 	.threaded	= true,
 };
-
-#ifdef CONFIG_VE
-#include <uapi/linux/beancounter.h>
-
-void pids_sync_ub(struct css_set *cset, struct ubparm *p)
-{
-	struct cgroup_subsys_state *css = cset->subsys[pids_cgrp_id];
-	struct pids_cgroup *pids = css_pids(css);
-
-	p->barrier = pids->limit;
-	p->limit = pids->limit;
-
-	if (cset != &init_css_set) {
-		p->held = atomic64_read(&pids->counter);
-		p->failcnt = atomic64_read(&pids->events_limit);
-	} else {
-		struct cgroup_subsys_state *child;
-
-		p->held = 0;
-		p->failcnt = 0;
-
-		rcu_read_lock();
-		css_for_each_child(child, css) {
-			pids = css_pids(child);
-
-			p->held += atomic64_read(&pids->counter);
-			p->failcnt += atomic64_read(&pids->events_limit);
-		}
-		rcu_read_unlock();
-	}
-}
-
-#endif
diff --git a/kernel/ve/bc/resources.c b/kernel/ve/bc/resources.c
index 25eb9bb53ad5..343e3d82fd98 100644
--- a/kernel/ve/bc/resources.c
+++ b/kernel/ve/bc/resources.c
@@ -15,8 +15,6 @@
 
 #include "proc.h"
 
-extern void pids_sync_ub(struct css_set *cset, struct ubparm *ub_parms);
-
 /* Generic output formats */
 const char *bc_proc_lu_fmt = "\t%-20s %21lu\n";
 const char *bc_proc_lu_lfmt = "\t%-20s %21lu\n";
@@ -112,7 +110,6 @@ static void ub_show_res(struct seq_file *f, struct ubparm *p, const char *name,
 
 static void cgroups_sync_ub(struct css_set *cset, struct ubparm *ub_parms)
 {
-	pids_sync_ub(cset, &ub_parms[UB_NUMPROC]);
 }
 
 static void __show_resources(struct seq_file *f, struct ve_struct *ve,
-- 
2.26.2



More information about the Devel mailing list