[Devel] [PATCH rh7 1/5] ub: remove CONFIG_BC_RSS_ACCOUNTING
Vladimir Davydov
vdavydov at parallels.com
Mon May 18 07:24:56 PDT 2015
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 73614cfd13e7..93f8d6ff4a22 100644
--- a/config.OpenVZ
+++ b/config.OpenVZ
@@ -5300,7 +5300,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 4b8156690c46..a3379f949d3c 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 dd33d44a2cb0..af6a610a3e08 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);
--
1.7.10.4
More information about the Devel
mailing list