All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Winchell <dwinchell@virtualiron.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: dan.magenheimer@oracle.com,
	xen-devel <xen-devel@lists.xensource.com>,
	Ben Guthro <bguthro@virtualiron.com>
Subject: Re: [PATCH 0/2] Improve hpet accuracy
Date: Tue, 10 Jun 2008 13:13:56 -0400	[thread overview]
Message-ID: <484EB654.4010801@virtualiron.com> (raw)
In-Reply-To: <C474353A.21E15%keir.fraser@eu.citrix.com>

[-- Attachment #1: Type: text/plain, Size: 141 bytes --]

Keir, Dan:

Although I plan to break up the patch, etc., I'm posting
this fix to the patch for anyone who might be interested.

thanks,
Dave

[-- Attachment #2: p.6.10.time.c --]
[-- Type: text/x-csrc, Size: 1209 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2008/06/10 12:20:48-04:00 winchell@dwinchell2.virtualiron.com 
#   vi-patch: xen-hpet
#   
#   Bug Id: 6057 
#   
#   Reviewed by: Robert
#   
#   SUMMARY: Fix wrap issue in monotonic s_time().
# 
# xen/arch/x86/time.c
#   2008/06/10 12:20:48-04:00 winchell@dwinchell2.virtualiron.com +3 -2
#   Fix wrap issue in monotonic s_time().
# 
diff -Nru a/xen/arch/x86/time.c b/xen/arch/x86/time.c
--- a/xen/arch/x86/time.c	2008-06-10 13:08:39 -04:00
+++ b/xen/arch/x86/time.c	2008-06-10 13:08:39 -04:00
@@ -534,7 +534,7 @@
     u64 count;
     unsigned long flags;
     struct cpu_time *t = &this_cpu(cpu_time);
-    u64 tsc, delta;
+    u64 tsc, delta, diff;
     s_time_t now;
 
     if(hpet_main_counter_phys_avoid_hdw || !hpet_physical_inited) {
@@ -542,7 +542,8 @@
         rdtscll(tsc);
         delta = tsc - t->local_tsc_stamp;
         now = t->stime_local_stamp + scale_delta(delta, &t->tsc_scale);
-        if(now > get_s_time_mon.last_ret)
+        diff = (u64)now - (u64)get_s_time_mon.last_ret;
+        if((s64)diff > (s64)0)
             get_s_time_mon.last_ret = now;
         else
             now = get_s_time_mon.last_ret;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

  reply	other threads:[~2008-06-10 17:13 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-05 14:59 [PATCH 0/2] Improve hpet accuracy Ben Guthro
2008-06-06  8:58 ` Keir Fraser
2008-06-06 10:45   ` Dave Winchell
2008-06-06 15:53     ` Dan Magenheimer
2008-06-06 17:54       ` Dave Winchell
2008-06-06 19:33       ` Dave Winchell
2008-06-06 20:29         ` Dan Magenheimer
2008-06-06 22:34           ` Keir Fraser
2008-06-07 21:20             ` Dave Winchell
2008-06-09 21:07               ` Dan Magenheimer
2008-06-09 21:44                 ` Dave Winchell
2008-06-08 20:32           ` Dave Winchell
2008-06-08 21:10             ` Dan Magenheimer
2008-06-08 23:26               ` Dave Winchell
2008-06-09  7:36                 ` Keir Fraser
2008-06-09 11:13                   ` Dave Winchell
2008-06-09 12:03                     ` Keir Fraser
2008-06-09 12:10                       ` Keir Fraser
2008-06-09 13:08                         ` Dave Winchell
2008-06-09 20:48                   ` Dan Magenheimer
2008-06-09 21:18                     ` Keir Fraser
2008-06-09 21:46                       ` Dan Magenheimer
2008-06-08 21:18             ` Dan Magenheimer
2008-06-09 22:02             ` Dan Magenheimer
2008-06-09 23:34               ` Dave Winchell
2008-06-10  3:21                 ` Dan Magenheimer
2008-06-11  1:44                   ` Dan Magenheimer
2008-06-11 13:58                     ` Dave Winchell
2008-06-11 16:47                       ` Dan Magenheimer
2008-06-12 22:51                     ` Dan Magenheimer
2008-06-10  7:52                 ` Keir Fraser
2008-06-10 11:49                   ` Dave Winchell
2008-06-10 12:34                     ` Dave Winchell
2008-06-10 12:42                       ` Keir Fraser
2008-06-10 17:13                         ` Dave Winchell [this message]
2008-06-11  8:30                           ` Keir Fraser
2008-06-11 11:38                             ` Dave Winchell
2008-06-06 15:35 ` Steven Hand
2008-06-06 17:34   ` Dave Winchell
     [not found] <4851940F.2050307@virtualiron.com>
2008-06-12 22:05 ` Dan Magenheimer
2008-06-12 22:49   ` Dave Winchell
2008-06-13  4:47     ` Dan Magenheimer
2008-06-13  7:33       ` Keir Fraser
2008-06-13 15:39         ` Dan Magenheimer
2008-06-13 12:08       ` Dave Winchell
2008-06-13 14:58         ` Dave Winchell
2008-06-13 15:52         ` Dan Magenheimer
2008-06-13 16:53           ` Dave Winchell
2008-06-13  0:38   ` Dave Winchell
2008-06-13  2:21     ` Dan Magenheimer
2008-06-13  3:12       ` Dave Winchell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=484EB654.4010801@virtualiron.com \
    --to=dwinchell@virtualiron.com \
    --cc=bguthro@virtualiron.com \
    --cc=dan.magenheimer@oracle.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.