diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2018-10-02 10:26:02 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-02 10:26:02 -0300 |
commit | 5f3fecbc0715a70437501e1d85e74726c4f561be (patch) | |
tree | f10a85be5659f9b2f8f3ca4aff41d8fd3aa01b37 /kernel/time/timer.c | |
parent | ded0ac8f40f9561d8ab2f8ef6c9ff8dc435f2b41 (diff) | |
parent | c98b0c5db65001d10d7f0af026801b9c193c369e (diff) |
Merge pull request #38 from gibsson/4.9-2.3.x-imx
Merge v4.9.130 into 4.9-2.3.x imx
Diffstat (limited to 'kernel/time/timer.c')
-rw-r--r-- | kernel/time/timer.c | 29 |
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])); |