summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2012-09-17 21:38:46 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2013-01-16 16:44:53 -0500
commitb4e2564c9f5ba83af10076d029a7507b7a33b870 (patch)
tree87a6ee636d0380243968b1a60373d0ad9a84db5b /kernel
parent11ce0e7a9396b85a6f42cec5ec009d70d7b10652 (diff)
downloadlinux-b4e2564c9f5ba83af10076d029a7507b7a33b870.tar.gz
linux-b4e2564c9f5ba83af10076d029a7507b7a33b870.tar.bz2
linux-b4e2564c9f5ba83af10076d029a7507b7a33b870.zip
time: Avoid making adjustments if we haven't accumulated anything
commit bf2ac312195155511a0f79325515cbb61929898a upstream. If update_wall_time() is called and the current offset isn't large enough to accumulate, avoid re-calling timekeeping_adjust which may change the clock freq and can cause 1ns inconsistencies with CLOCK_REALTIME_COARSE/CLOCK_MONOTONIC_COARSE. Signed-off-by: John Stultz <john.stultz@linaro.org> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Link: http://lkml.kernel.org/r/1345595449-34965-5-git-send-email-john.stultz@linaro.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Linux Kernel <linux-kernel@vger.kernel.org> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/time/timekeeping.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 0d59077c3fe8..bbdad71aa90f 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -849,6 +849,10 @@ void update_wall_time(void)
#else
offset = timekeeper.cycle_interval;
#endif
+ /* Check if there's really nothing to do */
+ if (offset < timekeeper.cycle_interval)
+ return;
+
timekeeper.xtime_nsec = (s64)xtime.tv_nsec << timekeeper.shift;
/*