Re: [PATCH v1] timers: Clear must_forward_clk inside base lock
From: Thomas Gleixner
Date: Wed Aug 01 2018 - 12:05:23 EST
On Wed, 1 Aug 2018, Gaurav Kohli wrote:
> @@ -1657,6 +1657,17 @@ static inline void __run_timers(struct timer_base *base)
>
> raw_spin_lock_irq(&base->lock);
>
> + /*
> + * 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);
> @@ -1676,19 +1687,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.
You lost this part of the comment ....
Thanks,
tglx