summaryrefslogtreecommitdiff
path: root/kernel/time
diff options
context:
space:
mode:
authorGary Bisson <gary.bisson@boundarydevices.com>2018-09-24 14:01:55 +0200
committerGary Bisson <gary.bisson@boundarydevices.com>2018-09-24 14:01:55 +0200
commitcc9333d7aace5c1de4e81932870b53bb6614dedd (patch)
tree835717abb66260b86e6116fe1e1871e1c128bf06 /kernel/time
parentded0ac8f40f9561d8ab2f8ef6c9ff8dc435f2b41 (diff)
parent70915e25e1cff60c32e79e5b02e9559c1ed7bab2 (diff)
Merge tag 'v4.9.128' into 4.9-2.3.x-imx
This is the 4.9.128 stable release
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/timer.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index 7c477912f36d..b625cc7fcc1c 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1649,6 +1649,22 @@ static inline void __run_timers(struct timer_base *base)
spin_lock_irq(&base->lock);
+ /*
+ * timer_base::must_forward_clk must be cleared before running
+ * timers so that any timer functions that call mod_timer() will
+ * not try to forward the base. Idle tracking / clock forwarding
+ * logic is only used with BASE_STD timers.
+ *
+ * The must_forward_clk flag is cleared unconditionally also for
+ * the deferrable base. The deferrable base is not affected by idle
+ * tracking and never forwarded, so clearing the flag is a NOOP.
+ *
+ * The fact that the deferrable base is never forwarded can cause
+ * large variations in granularity for deferrable timers, but they
+ * can be deferred for long periods due to idle anyway.
+ */
+ base->must_forward_clk = false;
+
while (time_after_eq(jiffies, base->clk)) {
levels = collect_expired_timers(base, heads);
@@ -1668,19 +1684,6 @@ static __latent_entropy void run_timer_softirq(struct softirq_action *h)
{
struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]);
- /*
- * must_forward_clk must be cleared before running timers so that any
- * timer functions that call mod_timer will not try to forward the
- * base. idle trcking / clock forwarding logic is only used with
- * BASE_STD timers.
- *
- * The deferrable base does not do idle tracking at all, so we do
- * not forward it. This can result in very large variations in
- * granularity for deferrable timers, but they can be deferred for
- * long periods due to idle.
- */
- base->must_forward_clk = false;
-
__run_timers(base);
if (IS_ENABLED(CONFIG_NO_HZ_COMMON))
__run_timers(this_cpu_ptr(&timer_bases[BASE_DEF]));