[Devel] [PATCH RH7 2/3] cgroup: make cgroup_get_ve_root visible in kernel/sched/core.c

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Wed Nov 1 16:49:10 MSK 2017


Need it to find out root ve cgroup for nr_cpus and cpu_rate.

Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 include/linux/ve.h | 7 +++++++
 kernel/cgroup.c    | 7 +------
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/linux/ve.h b/include/linux/ve.h
index 7999746a041c..486fa24d25c0 100644
--- a/include/linux/ve.h
+++ b/include/linux/ve.h
@@ -226,6 +226,8 @@ extern void vtty_release(struct tty_struct *tty, struct tty_struct *o_tty,
 extern bool vtty_is_master(struct tty_struct *tty);
 #endif /* CONFIG_TTY */
 
+extern struct cgroup *cgroup_get_ve_root(struct cgroup *cgrp);
+
 #else	/* CONFIG_VE */
 
 #define ve_uevent_seqnum uevent_seqnum
@@ -259,6 +261,11 @@ static inline void monotonic_abs_to_ve(clockid_t which_clock,
 				struct timespec *tp) { }
 static inline void monotonic_ve_to_abs(clockid_t which_clock,
 				struct timepsec *tp) { }
+
+static inline struct cgroup *cgroup_get_ve_root(struct cgroup *cgrp)
+{
+	return NULL;
+}
 #endif	/* CONFIG_VE */
 
 struct seq_file;
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 06863de12c6e..51ce4abdaf02 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4280,7 +4280,7 @@ void cgroup_mark_ve_root(struct ve_struct *ve)
 	mutex_unlock(&cgroup_mutex);
 }
 
-static struct cgroup *cgroup_get_ve_root(struct cgroup *cgrp)
+struct cgroup *cgroup_get_ve_root(struct cgroup *cgrp)
 {
 	struct cgroup *ve_root = NULL;
 
@@ -4294,11 +4294,6 @@ static struct cgroup *cgroup_get_ve_root(struct cgroup *cgrp)
 
 	return ve_root;
 }
-#else
-static inline struct cgroup *cgroup_get_ve_root(struct cgroup *cgrp)
-{
-	return NULL;
-}
 #endif
 
 /*
-- 
2.13.5



More information about the Devel mailing list