Skip to content

Commit a80e49e

Browse files
committed
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>
1 parent 2ce7598 commit a80e49e

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎include/linux/tick.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,12 @@ static inline bool tick_nohz_full_cpu(int cpu)
181181
return cpumask_test_cpu(cpu, tick_nohz_full_mask);
182182
}
183183

184-
extern void tick_nohz_init(void);
185184
extern void __tick_nohz_full_check(void);
186185
extern void tick_nohz_full_kick(void);
187186
extern void tick_nohz_full_kick_cpu(int cpu);
188187
extern void tick_nohz_full_kick_all(void);
189188
extern void __tick_nohz_task_switch(struct task_struct *tsk);
190189
#else
191-
static inline void tick_nohz_init(void) { }
192190
static inline bool tick_nohz_full_enabled(void) { return false; }
193191
static inline bool tick_nohz_full_cpu(int cpu) { return false; }
194192
static inline void __tick_nohz_full_check(void) { }

‎init/main.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,6 @@ asmlinkage __visible void __init start_kernel(void)
577577
local_irq_disable();
578578
idr_init_cache();
579579
rcu_init();
580-
tick_nohz_init();
581580
context_tracking_init();
582581
radix_tree_init();
583582
/* init some links before init_ISA_irqs() */

‎kernel/time/tick-common.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,4 +400,5 @@ void tick_resume(void)
400400
void __init tick_init(void)
401401
{
402402
tick_broadcast_init();
403+
tick_nohz_init();
403404
}

‎kernel/time/tick-internal.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ static inline int tick_broadcast_oneshot_active(void) { return 0; }
9999
static inline bool tick_broadcast_oneshot_available(void) { return false; }
100100
#endif /* !TICK_ONESHOT */
101101

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+
102109
/*
103110
* Broadcasting support
104111
*/

0 commit comments

Comments
 (0)