diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2014-08-16 11:47:18 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2014-09-13 12:34:44 -0400 |
commit | a80e49e2cc3145af014a8ae44f575829cc236192 (patch) | |
tree | 61ee13c12752cf1e7f4f2aa9ecbcce9838f6817e | |
parent | 2ce7598c9a453e0acd0e07be7be3f5eb39608ebd (diff) |
nohz: Move nohz full init call to tick init
This way we unbloat a bit main.c and more importantly we initialize
nohz full after init_IRQ(). This dependency will be needed in further
patches because nohz full needs irq work to raise its own IRQ.
Information about the support for this ability on ARM64 is obtained on
init_IRQ() which initialize the pointer to __smp_call_function.
Since tick_init() is called right after init_IRQ(), this is a good place
to call tick_nohz_init() and prepare for that dependency.
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
-rw-r--r-- | include/linux/tick.h | 2 | ||||
-rw-r--r-- | init/main.c | 1 | ||||
-rw-r--r-- | kernel/time/tick-common.c | 1 | ||||
-rw-r--r-- | kernel/time/tick-internal.h | 7 |
4 files changed, 8 insertions, 3 deletions
diff --git a/include/linux/tick.h b/include/linux/tick.h index 9a82c7dc3fdd..595ee86f5e0d 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -181,14 +181,12 @@ static inline bool tick_nohz_full_cpu(int cpu) | |||
181 | return cpumask_test_cpu(cpu, tick_nohz_full_mask); | 181 | return cpumask_test_cpu(cpu, tick_nohz_full_mask); |
182 | } | 182 | } |
183 | 183 | ||
184 | extern void tick_nohz_init(void); | ||
185 | extern void __tick_nohz_full_check(void); | 184 | extern void __tick_nohz_full_check(void); |
186 | extern void tick_nohz_full_kick(void); | 185 | extern void tick_nohz_full_kick(void); |
187 | extern void tick_nohz_full_kick_cpu(int cpu); | 186 | extern void tick_nohz_full_kick_cpu(int cpu); |
188 | extern void tick_nohz_full_kick_all(void); | 187 | extern void tick_nohz_full_kick_all(void); |
189 | extern void __tick_nohz_task_switch(struct task_struct *tsk); | 188 | extern void __tick_nohz_task_switch(struct task_struct *tsk); |
190 | #else | 189 | #else |
191 | static inline void tick_nohz_init(void) { } | ||
192 | static inline bool tick_nohz_full_enabled(void) { return false; } | 190 | static inline bool tick_nohz_full_enabled(void) { return false; } |
193 | static inline bool tick_nohz_full_cpu(int cpu) { return false; } | 191 | static inline bool tick_nohz_full_cpu(int cpu) { return false; } |
194 | static inline void __tick_nohz_full_check(void) { } | 192 | static inline void __tick_nohz_full_check(void) { } |
diff --git a/init/main.c b/init/main.c index bb1aed928f21..8af2f1abfe38 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -577,7 +577,6 @@ asmlinkage __visible void __init start_kernel(void) | |||
577 | local_irq_disable(); | 577 | local_irq_disable(); |
578 | idr_init_cache(); | 578 | idr_init_cache(); |
579 | rcu_init(); | 579 | rcu_init(); |
580 | tick_nohz_init(); | ||
581 | context_tracking_init(); | 580 | context_tracking_init(); |
582 | radix_tree_init(); | 581 | radix_tree_init(); |
583 | /* init some links before init_ISA_irqs() */ | 582 | /* init some links before init_ISA_irqs() */ |
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index 0a0608edeb26..052b4b53c3d6 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c | |||
@@ -400,4 +400,5 @@ void tick_resume(void) | |||
400 | void __init tick_init(void) | 400 | void __init tick_init(void) |
401 | { | 401 | { |
402 | tick_broadcast_init(); | 402 | tick_broadcast_init(); |
403 | tick_nohz_init(); | ||
403 | } | 404 | } |
diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h index c19c1d84b6f3..366aeb4f2c66 100644 --- a/kernel/time/tick-internal.h +++ b/kernel/time/tick-internal.h | |||
@@ -99,6 +99,13 @@ static inline int tick_broadcast_oneshot_active(void) { return 0; } | |||
99 | static inline bool tick_broadcast_oneshot_available(void) { return false; } | 99 | static inline bool tick_broadcast_oneshot_available(void) { return false; } |
100 | #endif /* !TICK_ONESHOT */ | 100 | #endif /* !TICK_ONESHOT */ |
101 | 101 | ||
102 | /* NO_HZ_FULL internal */ | ||
103 | #ifdef CONFIG_NO_HZ_FULL | ||
104 | extern void tick_nohz_init(void); | ||
105 | # else | ||
106 | static inline void tick_nohz_init(void) { } | ||
107 | #endif | ||
108 | |||
102 | /* | 109 | /* |
103 | * Broadcasting support | 110 | * Broadcasting support |
104 | */ | 111 | */ |