Thread (22 messages) 22 messages, 5 authors, 2014-02-03
STALE4512d

[PATCH 2/2] timer: really raise softirq if there is irq_work to do

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: 2014-01-31 14:34:15
Also in: lkml
Subsystem: the rest · Maintainer: Linus Torvalds

from looking at the code, it seems that the softirq is only raised (in
the !base->active_timers case) if we have also an expired timer
(time_before_eq() is true). This patch ensures that the timer softirq is
also raised in the !base->active_timers && no timer expired.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 kernel/timer.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kernel/timer.c b/kernel/timer.c
index 6b3c172..b04c879 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1453,6 +1453,7 @@ static void run_timer_softirq(struct softirq_action *h)
 void run_local_timers(void)
 {
 	struct tvec_base *base = __this_cpu_read(tvec_bases);
+	bool need_raise = false;
 
 	hrtimer_run_queues();
 	/*
@@ -1470,12 +1471,17 @@ void run_local_timers(void)
 #ifdef CONFIG_PREEMPT_RT_FULL
 		/* On RT, irq work runs from softirq */
 		if (!irq_work_needs_cpu())
-#endif
 			goto out;
+		need_raise = true;
+#else
+		goto out;
+#endif
 	}
 
 	/* Check whether the next pending timer has expired */
 	if (time_before_eq(base->next_timer, jiffies))
+		need_raise = true;
+	if (need_raise)
 		raise_softirq(TIMER_SOFTIRQ);
 out:
 #ifdef CONFIG_PREEMPT_RT_FULL
-- 
1.8.5.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help