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

From: Sebastian Andrzej Siewior
Date: Fri Jan 31 2014 - 09:34:23 EST


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@xxxxxxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/