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

[Xen-changelog] [linux-2.6.18-xen] Don't clip the TSC-derived usec value to <1tick in gettimeofday.



# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1182363456 -3600
# Node ID cadc6d58a9e63dd7e590eafc06a99cd68faa42b4
# Parent  496e3157a35c32d7a550223914cfb92389a80874
Don't clip the TSC-derived usec value to <1tick in gettimeofday.
This fixes some very odd gettimeofday() results when NTP is
adjtimex()ing the clock backwards.
Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
---
 arch/i386/kernel/time-xen.c |   14 +-------------
 1 files changed, 1 insertion(+), 13 deletions(-)

diff -r 496e3157a35c -r cadc6d58a9e6 arch/i386/kernel/time-xen.c
--- a/arch/i386/kernel/time-xen.c       Wed Jun 20 14:39:34 2007 +0100
+++ b/arch/i386/kernel/time-xen.c       Wed Jun 20 19:17:36 2007 +0100
@@ -384,19 +384,7 @@ void do_gettimeofday(struct timeval *tv)
                usec = get_usec_offset(shadow);
                lost = jiffies - wall_jiffies;
 
-               /*
-                * If time_adjust is negative then NTP is slowing the clock
-                * so make sure not to go into next possible interval.
-                * Better to lose some accuracy than have time go backwards..
-                */
-               if (unlikely(time_adjust < 0)) {
-                       max_ntp_tick = (USEC_PER_SEC / HZ) - tickadj;
-                       usec = min(usec, max_ntp_tick);
-
-                       if (lost)
-                               usec += lost * max_ntp_tick;
-               }
-               else if (unlikely(lost))
+               if (unlikely(lost))
                        usec += lost * (USEC_PER_SEC / HZ);
 
                sec = xtime.tv_sec;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.