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

[Xen-bugs] [Bug 1098] [version 3.1.0_15042-51] clocksource/0: Time went backwards



http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1098





------- Comment #8 from sakaia@xxxxxxxxxxxxxx  2007-11-01 20:34 -------
You should replace the function from opensuse kernel to linux 2.6.23
opensuse code does not consider sync to hypervisor.

====opensuse 2.6.22 xen3-patch-2.6.18 ===
+static cycle_t xen_clocksource_read(void)
+{
+       int cpu = get_cpu();
+       struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
+       cycle_t ret;
+
+       get_time_values_from_xen(cpu);
+
+       ret = shadow->system_timestamp + get_nsec_offset(shadow);
+
+       put_cpu();
+
+#ifdef CONFIG_SMP
+       for (;;) {
+               static cycle_t last_ret;
+#ifndef CONFIG_64BIT
+               cycle_t last = cmpxchg64(&last_ret, 0, 0);
+#else
+               cycle_t last = last_ret;
+#define cmpxchg64 cmpxchg
+#endif
+
+               if ((s64)(ret - last) < 0) {
+                       if (last - ret > permitted_clock_jitter
+                           && printk_ratelimit())
+                               printk(KERN_WARNING "clocksource/%d: "
+                                      "Time went backwards: "
+                                      "delta=%Ld shadow=%Lu offset=%Lu\n",
+                                      cpu, ret - last,
+                                      shadow->system_timestamp,
+                                      get_nsec_offset(shadow));
+                       ret = last;
+               }
+               if (cmpxchg64(&last_ret, last, ret) == last)
+                       break;
+       }
+#endif
+
+       return ret;
+}

==> to Linux 2.6.23 xen_clocksource_read.

static cycle_t xen_clocksource_read(void)
{
        struct shadow_time_info *shadow = &get_cpu_var(shadow_time);
        cycle_t ret;
        unsigned version;

        do {
                version = get_time_values_from_xen();
                barrier();
                ret = shadow->system_timestamp + get_nsec_offset(shadow);
                barrier();
        } while (version != __get_cpu_var(xen_vcpu)->time.version);

        put_cpu_var(shadow_time);

        return ret;
}


-- 
Configure bugmail: 
http://bugzilla.xensource.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


 


Rackspace

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