[Devel] [PATCH vz8 4/4] Revert "ve/bc: add proc beancounter directory for each ve"
Andrey Ryabinin
aryabinin at virtuozzo.com
Tue Apr 28 18:32:52 MSK 2020
This reverts commit 5078062e9bc7e7b6f5be0d5e45f1cc5638dfdc53.
Remove /proc/bc/<id>/ directory as its empty.
https://jira.sw.ru/browse/PSBM-80807
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
include/linux/ve.h | 3 ---
kernel/ve/Makefile | 2 --
kernel/ve/bc/Makefile | 7 -------
kernel/ve/bc/proc.c | 42 ------------------------------------------
kernel/ve/bc/proc.h | 20 --------------------
kernel/ve/ve.c | 9 ---------
6 files changed, 83 deletions(-)
delete mode 100644 kernel/ve/bc/Makefile
delete mode 100644 kernel/ve/bc/proc.c
delete mode 100644 kernel/ve/bc/proc.h
diff --git a/include/linux/ve.h b/include/linux/ve.h
index 44593c5cc3ed..7eaa0421d689 100644
--- a/include/linux/ve.h
+++ b/include/linux/ve.h
@@ -23,7 +23,6 @@ struct super_block;
struct tty_driver;
struct tty_struct;
struct cn_private;
-struct proc_dir_entry;
struct ve_struct {
struct cgroup_subsys_state css;
@@ -93,8 +92,6 @@ struct ve_struct {
#ifdef CONFIG_CONNECTOR
struct cn_private *cn;
#endif
-
- struct proc_dir_entry *ub_proc;
};
#define VE_MEMINFO_DEFAULT 1 /* default behaviour */
diff --git a/kernel/ve/Makefile b/kernel/ve/Makefile
index a49c56b6f140..88de340e023f 100644
--- a/kernel/ve/Makefile
+++ b/kernel/ve/Makefile
@@ -13,5 +13,3 @@ obj-$(CONFIG_VE_CALLS) += vzmon.o
vzmon-objs = vecalls.o
obj-$(CONFIG_VE_CALLS) += vzstat.o
-
-obj-y += bc/
diff --git a/kernel/ve/bc/Makefile b/kernel/ve/bc/Makefile
deleted file mode 100644
index c6ec2226e61e..000000000000
--- a/kernel/ve/bc/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# kernel/ve/Makefile
-#
-# Copyright (c) 2000-2017 Virtuozzo International GmbH. All rights reserved.
-#
-
-obj-$(CONFIG_VE) += proc.o
diff --git a/kernel/ve/bc/proc.c b/kernel/ve/bc/proc.c
deleted file mode 100644
index 12c57b509496..000000000000
--- a/kernel/ve/bc/proc.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * kernel/ve/bc/proc.c
- *
- * Copyright (c) 2000-2018 Virtuozzo International GmbH.
- * All rights reserved.
- *
- */
-
-#include <linux/proc_fs.h>
-#include <linux/ve.h>
-
-#include "proc.h"
-
-static const char *ve_get_name(struct ve_struct *ve)
-{
- static const char *ve0_name = "0";
-
- if (ve_is_super(ve))
- return ve0_name;
- return ve->ve_name;
-}
-
-void ub_remove_proc(struct ve_struct *ve)
-{
- remove_proc_entry(ve_get_name(ve), bc_proc_root);
- ve->ub_proc = NULL;
-}
-
-int ub_create_proc(struct ve_struct *ve)
-{
- ve->ub_proc = proc_mkdir(ve_get_name(ve), bc_proc_root);
- if (!ve->ub_proc)
- return -ENOMEM;
-
- return 0;
-}
-
-static int __init ub_init_proc(void)
-{
- return ub_create_proc(get_ve0());
-}
-core_initcall(ub_init_proc);
diff --git a/kernel/ve/bc/proc.h b/kernel/ve/bc/proc.h
deleted file mode 100644
index 05a0c48da292..000000000000
--- a/kernel/ve/bc/proc.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * kernel/ve/bc/proc.h
- *
- * Copyright (c) 2000-2018 Virtuozzo International GmbH.
- * All rights reserved.
- *
- */
-
-#ifndef _KERNEL_VE_BC_PROC_H
-#define _KERNEL_VE_BC_PROC_H
-
-struct proc_dir_entry;
-struct ve_struct;
-
-extern struct proc_dir_entry *bc_proc_root;
-
-void ub_remove_proc(struct ve_struct *ve);
-int ub_create_proc(struct ve_struct *ve);
-
-#endif
diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index 28b1d0748061..8b83058b1423 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -25,8 +25,6 @@
#include <linux/vziptable_defs.h>
#include <uapi/linux/vzcalluser.h>
-#include "bc/proc.h"
-
#include "../cgroup/cgroup-internal.h" /* For cgroup_task_count() */
extern struct kmapset_set sysfs_ve_perms_set;
@@ -414,10 +412,6 @@ static int ve_start_container(struct ve_struct *ve)
if (err)
goto err_list;
- err = ub_create_proc(ve);
- if (err)
- goto err_ub;
-
err = ve_start_kthreadd(ve);
if (err)
goto err_kthreadd;
@@ -445,8 +439,6 @@ static int ve_start_container(struct ve_struct *ve)
err_umh:
ve_stop_kthreadd(ve);
err_kthreadd:
- ub_remove_proc(ve);
-err_ub:
ve_list_del(ve);
err_list:
ve_drop_context(ve);
@@ -509,7 +501,6 @@ void ve_exit_ns(struct pid_namespace *pid_ns)
* At this point all userspace tasks in container are dead.
*/
ve_hook_iterate_fini(VE_SS_CHAIN, ve);
- ub_remove_proc(ve);
ve_list_del(ve);
ve_drop_context(ve);
printk(KERN_INFO "CT: %s: stopped\n", ve_name(ve));
--
2.26.2
More information about the Devel
mailing list