summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2017-08-18 10:09:09 +0200
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2018-01-17 10:08:36 -0500
commit7dc2ca25b642ab8047372730919e18ce50f7a90c (patch)
tree2daab437f618f744d7ea7e8864dff80d2dbfeb8f
parent9f4eed615fb42df83d2134de99972e403cb905eb (diff)
downloadlinux-rt-7dc2ca25b642ab8047372730919e18ce50f7a90c.tar.gz
kernel/hrtimer: migrate deferred timer on CPU down
hrtimers, which were deferred to the softirq context, and expire between softirq shutdown and hrtimer migration are dangling around. If the CPU goes back up the list head will be initialized and this corrupts the timer's list. It will remain unnoticed until a hrtimer_cancel(). This moves those timers so they will expire. Cc: stable-rt@vger.kernel.org Reported-by: Mike Galbraith <efault@gmx.de> Tested-by: Mike Galbraith <efault@gmx.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r--kernel/time/hrtimer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 2c1597d2bd6d..2e869c707628 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1959,6 +1959,11 @@ static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
/* Clear the migration state bit */
timer->state &= ~HRTIMER_STATE_MIGRATE;
}
+#ifdef CONFIG_PREEMPT_RT_BASE
+ list_splice_tail(&old_base->expired, &new_base->expired);
+ if (!list_empty(&new_base->expired))
+ raise_softirq_irqoff(HRTIMER_SOFTIRQ);
+#endif
}
static void migrate_hrtimers(int scpu)