[Devel] [PATCH RHEL7 COMMIT] ub: remove CONFIG_BC_RSS_ACCOUNTING

Konstantin Khorenko khorenko at virtuozzo.com
Fri May 22 07:39:07 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.5
------>
commit 7908ef6f6f0696f3a5ea51fafc12c42696e6f287
Author: Vladimir Davydov <vdavydov at parallels.com>
Date:   Fri May 22 18:39:00 2015 +0400

    ub: remove CONFIG_BC_RSS_ACCOUNTING
    
    There's no point in it, because w/o it beancounters are useless. Plus,
    it isn't actually used throughout the code, because rss accounting is up
    to memcg now. So, just make CONFIG_BEANCOUNTERS depend on memcg and
    remove the option.
    
    Also, remove dependency on CONFIG_CGROUP_HUGETLB, because we don't
    actually require it.
    
    Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 config.OpenVZ     |  1 -
 kernel/bc/Kconfig | 19 ++++---------------
 kernel/bc/proc.c  |  8 --------
 3 files changed, 4 insertions(+), 24 deletions(-)

diff --git a/config.OpenVZ b/config.OpenVZ
index a5aacf2..68b5778 100644
--- a/config.OpenVZ
+++ b/config.OpenVZ
@@ -5301,7 +5301,6 @@ CONFIG_VZ_IOLIMIT=m
 # User resources
 #
 CONFIG_BEANCOUNTERS=y
-CONFIG_BC_RSS_ACCOUNTING=y
 CONFIG_BC_IO_ACCOUNTING=y
 CONFIG_BC_IO_PRIORITY=y
 CONFIG_BC_PROC=y
diff --git a/kernel/bc/Kconfig b/kernel/bc/Kconfig
index 4b81566..a3379f9 100644
--- a/kernel/bc/Kconfig
+++ b/kernel/bc/Kconfig
@@ -12,6 +12,10 @@ config BEANCOUNTERS
 	bool "Enable user resource accounting"
 	default y
 	select CGROUPS
+	select MEMCG
+	select MEMCG_KMEM
+	select MEMCG_SWAP if SWAP
+	select MEMCG_SWAP_ENABLED if SWAP
 	help 
           This patch provides accounting and allows to configure
           limits for user's consumption of exhaustible system resources.
@@ -26,21 +30,6 @@ config BEANCOUNTERS
           per-process basis.  Per-process accounting doesn't prevent malicious
           users from spawning a lot of resource-consuming processes.
 
-config BC_RSS_ACCOUNTING
-	bool "Account physical memory usage"
-	default y
-	depends on BEANCOUNTERS
-	select RESOURCE_COUNTERS
-	select MEMCG
-	select MEMCG_KMEM
-	select MEMCG_SWAP if SWAP
-	select MEMCG_SWAP_ENABLED if SWAP
-	select CGROUP_HUGETLB if HUGETLBFS
-	help
-          This allows to estimate per beancounter physical memory usage.
-          Implemented alghorithm accounts shared pages of memory as well,
-          dividing them by number of beancounter which use the page.
-
 config BC_IO_ACCOUNTING
 	bool "Account file I/O"
 	default y
diff --git a/kernel/bc/proc.c b/kernel/bc/proc.c
index dd33d44..af6a610 100644
--- a/kernel/bc/proc.c
+++ b/kernel/bc/proc.c
@@ -198,12 +198,7 @@ static struct bc_proc_entry bc_meminfo_entry = {
 	.u.show = bc_proc_meminfo_show,
 };
 
-#ifdef CONFIG_BC_RSS_ACCOUNTING
-
-#include <linux/memcontrol.h>
-
 #define K(x) ((x) << (PAGE_SHIFT - 10))
-
 static int bc_proc_nodeinfo_show(struct seq_file *f, void *v)
 {
 	int nid;
@@ -241,7 +236,6 @@ static struct bc_proc_entry bc_nodeinfo_entry = {
 	.name = "nodeinfo",
 	.u.show = bc_proc_nodeinfo_show,
 };
-#endif
 
 #if 0
 
@@ -931,9 +925,7 @@ static int __init ub_init_proc(void)
 //	bc_register_proc_entry(&bc_dcacheinfo_entry);
 	bc_register_proc_root_entry(&bc_all_resources_entry);
 	bc_register_proc_entry(&bc_meminfo_entry);
-#ifdef CONFIG_BC_RSS_ACCOUNTING
 	bc_register_proc_entry(&bc_nodeinfo_entry);
-#endif
 
 	entry = proc_create("user_beancounters",
 			S_IRUSR|S_ISVTX, NULL, &ub_file_operations);



More information about the Devel mailing list