diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2017-12-27 23:37:25 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-12-30 01:13:09 +0300 |
commit | 26456f87aca7157c057de65c9414b37f1ab881d1 (patch) | |
tree | fd5e08429f5b554a8403aea730495654eaa4a23f /include/linux/timer.h | |
parent | ced6d5c11d3e7b342f1a80f908e6756ebd4b8ddd (diff) | |
download | linux-26456f87aca7157c057de65c9414b37f1ab881d1.tar.xz |
timers: Reinitialize per cpu bases on hotplug
The timer wheel bases are not (re)initialized on CPU hotplug. That leaves
them with a potentially stale clk and next_expiry valuem, which can cause
trouble then the CPU is plugged.
Add a prepare callback which forwards the clock, sets next_expiry to far in
the future and reset the control flags to a known state.
Set base->must_forward_clk so the first timer which is queued will try to
forward the clock to current jiffies.
Fixes: 500462a9de65 ("timers: Switch to a non-cascading wheel")
Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: Anna-Maria Gleixner <anna-maria@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/alpine.DEB.2.20.1712272152200.2431@nanos
Diffstat (limited to 'include/linux/timer.h')
-rw-r--r-- | include/linux/timer.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/timer.h b/include/linux/timer.h index 04af640ea95b..2448f9cc48a3 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -207,9 +207,11 @@ unsigned long round_jiffies_up(unsigned long j); unsigned long round_jiffies_up_relative(unsigned long j); #ifdef CONFIG_HOTPLUG_CPU +int timers_prepare_cpu(unsigned int cpu); int timers_dead_cpu(unsigned int cpu); #else -#define timers_dead_cpu NULL +#define timers_prepare_cpu NULL +#define timers_dead_cpu NULL #endif #endif |