Re: Timer corruption when debugging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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









[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux