]> git.baikalelectronics.ru Git - kernel.git/commit
timekeeping: Add warnings when overflows or underflows are observed
authorJohn Stultz <john.stultz@linaro.org>
Thu, 12 Mar 2015 04:16:35 +0000 (21:16 -0700)
committerIngo Molnar <mingo@kernel.org>
Fri, 13 Mar 2015 07:07:05 +0000 (08:07 +0100)
commit5003616f35cc38b27d73778144fa9f4a56ea50f2
treea97024c64148b2286d9bce2470ac07b7614a5b82
parent401a0eaa208084abee334af05cdcb801dd435da8
timekeeping: Add warnings when overflows or underflows are observed

It was suggested that the underflow/overflow protection
should probably throw some sort of warning out, rather
than just silently fixing the issue.

So this patch adds some warnings here. The flag variables
used are not protected by locks, but since we can't print
from the reading functions, just being able to say we
saw an issue in the update interval is useful enough,
and can be slightly racy without real consequence.

The big complication is that we're only under a read
seqlock, so the data could shift under us during
our calculation to see if there was a problem. This
patch avoids this issue by nesting another seqlock
which allows us to snapshot the just required values
atomically. So we shouldn't see false positives.

I also added some basic rate-limiting here, since
on one build machine w/ skewed TSCs it was fairly
noisy at bootup.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Cc: Dave Jones <davej@codemonkey.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1426133800-29329-8-git-send-email-john.stultz@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/time/timekeeping.c