summaryrefslogtreecommitdiff
path: root/kernel/timer.c
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2014-01-31 17:07:57 (GMT)
committerScott Wood <scottwood@freescale.com>2014-04-10 00:19:31 (GMT)
commit9621d858da62206b8f25d6d89502d6c7bee191af (patch)
tree7ef9b0b9ee0468e5f0584d8b7ada852103f004cf /kernel/timer.c
parent3d5290963bde738abce3e3886f56f0f069d712cd (diff)
downloadlinux-fsl-qoriq-9621d858da62206b8f25d6d89502d6c7bee191af.tar.xz
timer/rt: Always raise the softirq if there's irq_work to be done
It was previously discovered that some systems would hang on boot up with a previous version of 3.12-rt. This was due to RCU using irq_work, and RT defers the irq_work to a softirq. But if there's no active timers, the softirq will not be raised, and RCU work will not get done, causing the system to hang. The fix was to check that if there was no active timers but irq_work to be done, then we should raise the softirq. But this fix was not 100% correct. It left out the case that there were active timers that were not expired yet. This would have the softirq not get raised even if there was irq work to be done. If there is irq_work to be done, then we must raise the timer softirq regardless of if there is active timers or whether they are expired or not. The softirq can handle those cases. But we can never ignore irq_work. As it is only PREEMPT_RT_FULL that requires irq_work to be done in the softirq, we can pull out the check in the active_timers condition, and make the code a bit cleaner by having the irq_work check separate, and put the code in with the other #ifdef PREEMPT_RT. If there is irq_work to be done, there's no need to check the active timers or if they are expired. Just raise the time softirq and be done with it. Otherwise, we can do the timer checks just like we do with non -rt. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Diffstat (limited to 'kernel/timer.c')
-rw-r--r--kernel/timer.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/kernel/timer.c b/kernel/timer.c
index ed9d3bd..31757c0 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1457,18 +1457,20 @@ void run_local_timers(void)
* the timer softirq.
*/
#ifdef CONFIG_PREEMPT_RT_FULL
+ /* On RT, irq work runs from softirq */
+ if (irq_work_needs_cpu()) {
+ raise_softirq(TIMER_SOFTIRQ);
+ return;
+ }
+
if (!spin_do_trylock(&base->lock)) {
raise_softirq(TIMER_SOFTIRQ);
return;
}
#endif
- if (!base->active_timers) {
-#ifdef CONFIG_PREEMPT_RT_FULL
- /* On RT, irq work runs from softirq */
- if (!irq_work_needs_cpu())
-#endif
- goto out;
- }
+
+ if (!base->active_timers)
+ goto out;
/* Check whether the next pending timer has expired */
if (time_before_eq(base->next_timer, jiffies))