[PATCH 0/3] hrtimer (related) fixes

From: Peter Zijlstra
Date: Wed Apr 15 2015 - 05:55:22 EST

Hi Thomas,

I spoke to you about these patches/bugs a fair few months ago but never got
around to properly fixing them. With your recent hrtimer work it got a lot
simpler, thanks!

So here are 3 patches, the first of which fixes a hrtimer bug that should be
much easier to expose after the next two patches.

The second one attempts to clean up some brainmelt in the CFS bandwidth timer;
the 'problem' there is that do not want to loose either the timer or a period.

- one could loose the timer by observing it active and not (re)starting it while
the callback had already decided to NORESTART.
- one could loose a period by having the restart forward the expiry time such
that the handler would not observe the overrun and properly account for it.

This is now all solved by not forwarding the timer from (re)start when active
and then unconditionally starting it. Yay for being able to start expired
timers -- note that it should still be very rare, since when the timer is
active it will most likely have just forwarded the expiry time from the

But note that unconditionally starting the timer would have easily triggered
the bug fixed by the first patch.

The third patch is an alternative to the perf patch you send out a few days
ago; it got stuck in this queue because it too suffers from these problems,
albeit at a much reduced risk because the code in question is 'never' triggered
(as demonstrated by this fail being there forever).

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/