On Thu, 28 Apr 2016, John Syne wrote: > > On Apr 28, 2016, at 1:14 AM, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote: > > It's not a race condition. By stopping the kernel you make the clocksource > > wrap around resulting in a negative delta. > That makes sense, however it seems that clocksource wraps every 172 seconds, > which doesnʼt make sense to me. Given a 32 bit number, I would expect > clocksource to wrap every 2,147 seconds. What am I missing? That would mean the clocksource runs at exactly one GHz. clocksource != timekeeping units. The math here is: nsec = delta * tk->mult + tk->xtime_nsec; So if delta is large enough, nsec might become negative. nsec >>= tk->shift; So because nsec is s64 the compiler preserves the signedness. Can you please print delta, tk->mult, tk->shift and tk->xtime_nsec for that case? Thanks, tglx