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

Submitted by Pavel Tikhomirov on Nov. 1, 2017, 1:49 p.m.

Details

Message ID 20171101134911.31805-3-ptikhomirov@virtuozzo.com
State New
Series "ve: properly handle nr_cpus and cpu_rate for nested cgroups"
Headers show

Commit Message

Pavel Tikhomirov Nov. 1, 2017, 1:49 p.m.
Need it to find out root ve cgroup for nr_cpus and cpu_rate.

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

Patch hide | download patch | download mbox

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
 
 /*