[Devel] [PATCH 2/3] sched: Export calc_load_ve()

Kirill Tkhai ktkhai at virtuozzo.com
Wed Jul 18 13:50:21 MSK 2018


This will be used in next patch.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 include/linux/sched.h |    7 +++++++
 kernel/sched/core.c   |    6 ++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 1f7c39dc436e..1e0469df2cfb 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -186,6 +186,13 @@ extern atomic_t nr_dead;
 extern unsigned long nr_zombie;
 
 extern bool calc_global_load(unsigned long ticks);
+
+#ifdef CONFIG_VE
+extern void calc_load_ve(void);
+#else
+#define calc_load_ve()	do { } while (0)
+#endif
+
 extern void update_cpu_load_nohz(void);
 
 extern unsigned long get_parent_ip(unsigned long addr);
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index aa5422339e3d..693823a1bd36 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2883,7 +2883,7 @@ calc_load(unsigned long load, unsigned long exp, unsigned long active)
 #ifdef CONFIG_VE
 static LIST_HEAD(ve_root_list);
 
-static void calc_load_ve(void)
+void calc_load_ve(void)
 {
 	unsigned long nr_unint, nr_active;
 	struct task_group *tg;
@@ -2924,9 +2924,7 @@ static void calc_load_ve(void)
 	CALC_LOAD(kstat_glob.nr_unint_avg[2], EXP_15, nr_unint);
 	write_seqcount_end(&kstat_glob.nr_unint_avg_seq);
 }
-#else
-#define calc_load_ve()	do { } while (0)
-#endif
+#endif /* CONFIG_VE */
 
 #ifdef CONFIG_NO_HZ_COMMON
 /*



More information about the Devel mailing list