This reverts commit aa72673d7f96b3e3d0ad156c8578b36a1303a335.

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 <aryabi...@virtuozzo.com>
---
 kernel/ve/bc/resources.c |  2 --
 mm/memcontrol.c          | 25 -------------------------
 2 files changed, 27 deletions(-)

diff --git a/kernel/ve/bc/resources.c b/kernel/ve/bc/resources.c
index 6d4921e3a043..25eb9bb53ad5 100644
--- a/kernel/ve/bc/resources.c
+++ b/kernel/ve/bc/resources.c
@@ -16,7 +16,6 @@
 #include "proc.h"
 
 extern void pids_sync_ub(struct css_set *cset, struct ubparm *ub_parms);
-extern void memcg_sync_ub(struct css_set *cset, struct ubparm *ub_parms);
 
 /* Generic output formats */
 const char *bc_proc_lu_fmt = "\t%-20s %21lu\n";
@@ -114,7 +113,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]);
-       memcg_sync_ub(cset, ub_parms);
 }
 
 static void __show_resources(struct seq_file *f, struct ve_struct *ve,
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index b4e2537f624b..2f9e73c90346 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -7111,29 +7111,4 @@ static int __init mem_cgroup_swap_init(void)
 }
 subsys_initcall(mem_cgroup_swap_init);
 
-#ifdef CONFIG_VE
-
-#include <uapi/linux/beancounter.h>
-#include <linux/ve.h>
-
-void memcg_sync_ub(struct css_set *cset, struct ubparm *ub_parms)
-{
-       struct mem_cgroup *memcg = 
mem_cgroup_from_css(cset->subsys[memory_cgrp_id]);
-       unsigned long lim;
-       volatile struct ubparm *k;
-
-       k = &ub_parms[UB_KMEMSIZE];
-
-       //todo: check odd code - counting in bytes instead of pages. wtf???
-       k->held = page_counter_read(&memcg->kmem) << PAGE_SHIFT;
-       k->maxheld = memcg->kmem.watermark << PAGE_SHIFT;
-       k->failcnt = memcg->kmem.failcnt << PAGE_SHIFT;
-       lim = memcg->kmem.max << PAGE_SHIFT;
-       lim = lim >= (PAGE_COUNTER_MAX << PAGE_SHIFT) ? UB_MAXVALUE :
-               min_t(unsigned long long, lim, UB_MAXVALUE);
-       k->barrier = k->limit = lim;
-}
-
-#endif /* CONFIG_VE */
-
 #endif /* CONFIG_MEMCG_SWAP */
-- 
2.26.2

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to