linux/kernel/time
John Stultz 3c17ad19f0 timekeeping: Add debugging checks to warn if we see delays
Recently there's been requests for better sanity
checking in the time code, so that it's more clear
when something is going wrong, since timekeeping issues
could manifest in a large number of strange ways in
various subsystems.

Thus, this patch adds some extra infrastructure to
add a check to update_wall_time() to print two new
warnings:

 1) if we see the call delayed beyond the 'max_cycles'
    overflow point,

 2) or if we see the call delayed beyond the clocksource's
    'max_idle_ns' value, which is currently 50% of the
    overflow point.

This extra infrastructure is conditional on
a new CONFIG_DEBUG_TIMEKEEPING option, also
added in this patch - default off.

Tested this a bit by halting qemu for specified
lengths of time to trigger the warnings.

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-5-git-send-email-john.stultz@linaro.org
[ Improved the changelog and the messages a bit. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-03-13 08:06:58 +01:00
..
alarmtimer.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
clockevents.c clockevents: Introduce mode specific callbacks 2015-02-18 15:16:23 +01:00
clocksource.c clocksource: Add 'max_cycles' to 'struct clocksource' 2015-03-12 10:16:38 +01:00
hrtimer.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
itimer.c time/timers: Move all time(r) related files into kernel/time 2014-06-23 11:22:35 +02:00
jiffies.c timekeeping: Add debugging checks to warn if we see delays 2015-03-13 08:06:58 +01:00
Kconfig clocksource: Move cycle_last validation to core code 2014-07-23 15:01:51 -07:00
Makefile time: move the timecounter/cyclecounter code into its own file. 2014-12-30 18:29:25 -05:00
ntp_internal.h timekeeping: Convert timekeeping core to use timespec64s 2014-07-23 10:17:54 -07:00
ntp.c ntp: Fixup adjtimex freq validation on 32-bit systems 2015-02-18 14:50:10 +01:00
posix-clock.c kernel: Fix files explicitly needing EXPORT_SYMBOL infrastructure 2011-10-31 19:30:05 -04:00
posix-cpu-timers.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
posix-timers.c posix-timers: Fix stack info leak in timer_create() 2014-10-25 10:43:15 +02:00
sched_clock.c clocksource: Add 'max_cycles' to 'struct clocksource' 2015-03-12 10:16:38 +01:00
test_udelay.c time: Rename udelay_test.c to test_udelay.c 2014-11-21 11:59:55 -08:00
tick-broadcast-hrtimer.c tick: Fixup more fallout from hrtimer broadcast mode 2014-02-09 15:11:47 +01:00
tick-broadcast.c time: Replace __get_cpu_var uses 2014-08-26 13:45:44 -04:00
tick-common.c PM / sleep: Make it possible to quiesce timers during suspend-to-idle 2015-02-15 19:40:09 +01:00
tick-internal.h nohz: Move nohz full init call to tick init 2014-09-13 18:34:44 +02:00
tick-oneshot.c time: Replace __get_cpu_var uses 2014-08-26 13:45:44 -04:00
tick-sched.c time: use %*pb[l] to print bitmaps including cpumasks and nodemasks 2015-02-13 21:21:37 -08:00
time.c Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-01-25 17:47:34 -08:00
timeconst.bc time/timers: Move all time(r) related files into kernel/time 2014-06-23 11:22:35 +02:00
timeconv.c time: add function to convert between calendar time and broken-down time for universal use 2009-09-24 07:20:56 -07:00
timecounter.c timecounter: keep track of accumulated fractional nanoseconds 2014-12-30 18:29:27 -05:00
timekeeping_debug.c timekeeping: Convert timekeeping core to use timespec64s 2014-07-23 10:17:54 -07:00
timekeeping_internal.h clocksource: Move cycle_last validation to core code 2014-07-23 15:01:51 -07:00
timekeeping.c timekeeping: Add debugging checks to warn if we see delays 2015-03-13 08:06:58 +01:00
timekeeping.h PM / sleep: Make it possible to quiesce timers during suspend-to-idle 2015-02-15 19:40:09 +01:00
timer_list.c clockevents: Introduce mode specific callbacks 2015-02-18 15:16:23 +01:00
timer_stats.c timer stats: Add a 'Collection: active/inactive' line to timer usage statistics 2013-10-10 09:59:25 +02:00
timer.c rcu: Remove "cpu" argument to rcu_check_callbacks() 2014-11-03 19:20:11 -08:00