aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-07-04 05:50:37 -0400
committerIngo Molnar <mingo@kernel.org>2016-07-07 04:35:11 -0400
commit4e85876a9d2a977b4a07389da8c07edf76d10825 (patch)
tree4e0d4f1ba711f1c737309211a4c097c4ac994b94 /kernel/time
parenta683f390b93f4d1292f849fc48d28e322046120f (diff)
timers: Only wake softirq if necessary
With the wheel forwading in place and with the HZ=1000 4ms folding we can avoid running the softirq at all. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Arjan van de Ven <arjan@infradead.org> Cc: Chris Mason <clm@fb.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: George Spelvin <linux@sciencehorizons.net> Cc: Josh Triplett <josh@joshtriplett.org> Cc: Len Brown <lenb@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rik van Riel <riel@redhat.com> Cc: rt@linutronix.de Link: http://lkml.kernel.org/r/20160704094342.607650550@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/timer.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index 9339d71ee998..8d830f1f6a6a 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1608,7 +1608,18 @@ static void run_timer_softirq(struct softirq_action *h)
1608 */ 1608 */
1609void run_local_timers(void) 1609void run_local_timers(void)
1610{ 1610{
1611 struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]);
1612
1611 hrtimer_run_queues(); 1613 hrtimer_run_queues();
1614 /* Raise the softirq only if required. */
1615 if (time_before(jiffies, base->clk)) {
1616 if (!IS_ENABLED(CONFIG_NO_HZ_COMMON) || !base->nohz_active)
1617 return;
1618 /* CPU is awake, so check the deferrable base. */
1619 base++;
1620 if (time_before(jiffies, base->clk))
1621 return;
1622 }
1612 raise_softirq(TIMER_SOFTIRQ); 1623 raise_softirq(TIMER_SOFTIRQ);
1613} 1624}
1614 1625