Re: [PATCH v1] watchdog: Use a reference cycle counter to avoid scaling issues

From: Andi Kleen
Date: Thu Apr 23 2015 - 20:51:39 EST


> We can just detect the deviation in the callback itself:
>
> u64 now = ktime_get_mono_fast_ns();
>
> if (now - __this_cpu_read(nmi_timestamp) < period)
> return;
>
> __this_cpu_write(nmi_timestamp, now);
>
> It's that simple.

It's a simple short term hac^wsolution. But if we had a (hypothetical) system with
let's say 10*TSC max you may end up with quite a few false ticks, as in
unnecessary interrupts. With 100*TSC it would be really bad.

There were systems in the past that ran TSC at a much slower frequency,
such as the early AMD Barcelona systems.

So the problem may eventually come back if not solved properly.

-Andi

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only
--
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/