aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/sched/nohz.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-02-03 11:12:59 +0100
committerIngo Molnar <mingo@kernel.org>2017-03-03 01:43:43 +0100
commit752b3ca734cbc17c0456b846ae886c0ed39c5703 (patch)
treed5102243159fe04db42164395c85ecb5d0d5cd06 /include/linux/sched/nohz.h
parentsched/headers: Move task statistics APIs from <linux/sched.h> to <linux/sched/stat.h> (diff)
downloadwireguard-linux-752b3ca734cbc17c0456b846ae886c0ed39c5703.tar.xz
wireguard-linux-752b3ca734cbc17c0456b846ae886c0ed39c5703.zip
sched/headers: Move the NOHZ APIs from <linux/sched.h> to <linux/sched/nohz.h>
There's a number of NOHZ/dyntics related functionality in <linux/sched.h>, but only a handful of timer files are making use of them. Move them into their own header. This better documents these APIs and unclutters <linux/sched.h>. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/sched/nohz.h')
-rw-r--r--include/linux/sched/nohz.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/linux/sched/nohz.h b/include/linux/sched/nohz.h
index fe6caf0dab10..9471f0736a3a 100644
--- a/include/linux/sched/nohz.h
+++ b/include/linux/sched/nohz.h
@@ -3,4 +3,43 @@
#include <linux/sched.h>
+/*
+ * This is the interface between the scheduler and nohz/dyntics:
+ */
+
+#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
+extern void cpu_load_update_nohz_start(void);
+extern void cpu_load_update_nohz_stop(void);
+#else
+static inline void cpu_load_update_nohz_start(void) { }
+static inline void cpu_load_update_nohz_stop(void) { }
+#endif
+
+#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
+extern void nohz_balance_enter_idle(int cpu);
+extern void set_cpu_sd_state_idle(void);
+extern int get_nohz_timer_target(void);
+#else
+static inline void nohz_balance_enter_idle(int cpu) { }
+static inline void set_cpu_sd_state_idle(void) { }
+#endif
+
+#ifdef CONFIG_NO_HZ_COMMON
+void calc_load_enter_idle(void);
+void calc_load_exit_idle(void);
+#else
+static inline void calc_load_enter_idle(void) { }
+static inline void calc_load_exit_idle(void) { }
+#endif /* CONFIG_NO_HZ_COMMON */
+
+#if defined(CONFIG_NO_HZ_COMMON) && defined(CONFIG_SMP)
+extern void wake_up_nohz_cpu(int cpu);
+#else
+static inline void wake_up_nohz_cpu(int cpu) { }
+#endif
+
+#ifdef CONFIG_NO_HZ_FULL
+extern u64 scheduler_tick_max_deferment(void);
+#endif
+
#endif /* _LINUX_SCHED_NOHZ_H */