WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] repeatable time jump

To: David Becker <becker@xxxxxxxxxxx>
Subject: Re: [Xen-devel] repeatable time jump
From: Ian Pratt <Ian.Pratt@xxxxxxxxxxxx>
Date: Thu, 30 Sep 2004 21:46:07 +0100
Cc: Ian Pratt <Ian.Pratt@xxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxxx, Ian.Pratt@xxxxxxxxxxxx
Delivery-date: Fri, 01 Oct 2004 01:31:34 +0100
Envelope-to: steven.hand@xxxxxxxxxxxx
In-reply-to: Your message of "Wed, 29 Sep 2004 14:28:39 EDT." <20040929182839.GR921@xxxxxxxxxxx>
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
> 
> " always turned out to be 71 minutes 35 seconds, which is 2^32
> " usec.]
> 
> Huh, thats right. I'm seeing a 4294 second jump on the hosts that jump an 
> hour.
> It happens with both xm shutdown and xm destroy.

OK, this bug is now officially annoying me.

I've checked in a tiny fix I spotted in a code review, but I
doubt it will solve the problem. 

I think the easiest way to solve it since we can't reproduce
locally is to apply tracing.

David: please can you apply the following patch to
linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/time.c and see what
comes out when you run your test. It's also interesting to see
what output comes out after the time skip whenever you run date. 

Thanks,
Ian


--- 
/usr/groups/xeno/BK/xeno.bk/linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/time.c
    2004-09-30 21:14:58.000000000 +0100
+++ linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/time.c        2004-09-30 
21:28:09.000000000 +0100
@@ -114,28 +114,34 @@
 
 #define NS_PER_TICK (1000000000ULL/HZ)
 
-#define HANDLE_USEC_UNDERFLOW(_tv) do {                \
+#define HANDLE_USEC_UNDERFLOW(_tv) do {        int i=0;        \
        while ((_tv).tv_usec < 0) {             \
                (_tv).tv_usec += USEC_PER_SEC;  \
                (_tv).tv_sec--;                 \
-       }                                       \
+       }if(i>100)printk(KERN_ALERT"USEC_UNDER %d\n",i);        \
 } while (0)
-#define HANDLE_USEC_OVERFLOW(_tv) do {         \
+#define HANDLE_USEC_OVERFLOW(_tv) do { int i=0;        \
        while ((_tv).tv_usec >= USEC_PER_SEC) { \
                (_tv).tv_usec -= USEC_PER_SEC;  \
-               (_tv).tv_sec++;                 \
-       }                                       \
+               (_tv).tv_sec++; i++;            \
+       }if(i>100)printk(KERN_ALERT"USEC_OVER %d\n",i); \
 } while (0)
 static inline void __normalize_time(time_t *sec, s64 *nsec)
 {
+int i=0,j=0;
        while (*nsec >= NSEC_PER_SEC) {
                (*nsec) -= NSEC_PER_SEC;
                (*sec)++;
+               i++;
        }
        while (*nsec < 0) {
                (*nsec) += NSEC_PER_SEC;
                (*sec)--;
+               j++;
        }
+
+if( i>100 || j>100 ) printk(KERN_ALERT"normalize time %d %d\n",i,j);
+
 }
 
 /* Does this guest OS track Xen time, or set its wall clock independently? */
@@ -155,6 +161,8 @@
  */
 static void __get_time_values_from_xen(void)
 {
+long last = shadow_tv.tv_sec;
+
        shared_info_t *s = HYPERVISOR_shared_info;
 
        do {
@@ -169,6 +177,7 @@
        while (shadow_time_version != s->time_version1);
 
        cur_timer->mark_offset();
+if( shadow_tv.tv_sec-last > 600 ) printk(KERN_ALERT"**** 
__get_time_values_from_xen(void) JUPMED!\n");
 }
 
 #define TIME_VALUES_UP_TO_DATE \
@@ -241,6 +250,7 @@
            ((sec == last_seen_tv.tv_sec) && (usec < last_seen_tv.tv_usec))) {
                sec = last_seen_tv.tv_sec;
                usec = last_seen_tv.tv_usec;
+printk(KERN_ALERT"Clamp time %ld %ld\n",sec,last_seen_tv.tv_sec); 
        } else {
                last_seen_tv.tv_sec = sec;
                last_seen_tv.tv_usec = usec;





-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel

<Prev in Thread] Current Thread [Next in Thread>