Re: [patch 13/20] timer: Switch to a non cascading wheel

From: Thomas Gleixner
Date: Tue Jun 14 2016 - 12:51:01 EST


On Tue, 14 Jun 2016, George Spelvin wrote:
> Not enough to be interesting, and the extra levels increase processing
> time. If you need to shrink TIMER_ARRAYMASK to fit another flag bit,
> the easier way would be to encode only the level rather than the index,
> since you can derive the latter from level and expiry time trivially.

We can accomodate wheel with 512 buckets with the current ARRAYMASK and that
really should be enough.

> A couple of really minor tweaks that could be folded in, if Thomas feels
> like it:
>
> * It would make sense to move all the TIMER_ARRAYSHIFT/TIMER_ARRAYMASK
> stuff out of patch 13 and into patch 20.

The expiry code uses the pending_map already in patch 13 to avoid looking at
the bucket if its empty.

> * It would make sense to change the return type of mod_timer (& Co.)
> detach_if_pending, and del_timer to bool.
> ({try_to_,}del_timer_sync return 3 values.)

We can do that as a seperate patch. Makes sense.

Thanks,

tglx