Re: [patch 4 14/22] timer: Switch to a non cascading wheel

From: Richard Cochran
Date: Tue Aug 16 2016 - 03:57:33 EST


On Fri, Aug 12, 2016 at 01:50:16PM -0400, Rik van Riel wrote:
> Could that cause the new timer wheel code to skip over
> timer buckets occasionally, or is this hypothesis bunk?

The new wheel is not different from the old one in this respect. Each
base keeps its own jiffies counter. When returning from a long sleep,
the base counter can be behind the current jiffies value by more than
one. In __run_timers() we loop through all the missed jiffies:

while (time_after_eq(jiffies, base->clk)) {

levels = collect_expired_timers(base, heads);
base->clk++;

while (levels--)
expire_timers(base, heads + levels);
}

So the hypothesis is incorrect.

Thanks,
Richard