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-changelog

[Xen-changelog] [xen-unstable] [XEN] Fix the timeout workaround so it do

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEN] Fix the timeout workaround so it doesn't capture negative
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 30 Jun 2006 15:40:36 +0000
Delivery-date: Fri, 30 Jun 2006 08:45:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxxxx
# Node ID 3dfc2583a4f161a81ee0dcbba8e23e328577f687
# Parent  8242c0c24db75c7de381b69637b7b1be3f4780f1
[XEN] Fix the timeout workaround so it doesn't capture negative
diffs relative to current time.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/common/schedule.c |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff -r 8242c0c24db7 -r 3dfc2583a4f1 xen/common/schedule.c
--- a/xen/common/schedule.c     Thu Jun 29 15:02:38 2006 +0100
+++ b/xen/common/schedule.c     Thu Jun 29 16:59:47 2006 +0100
@@ -389,30 +389,30 @@ long do_set_timer_op(s_time_t timeout)
 long do_set_timer_op(s_time_t timeout)
 {
     struct vcpu *v = current;
+    s_time_t offset = timeout - NOW();
 
     if ( timeout == 0 )
     {
         stop_timer(&v->timer);
     }
+    else if ( unlikely(timeout < 0) || /* overflow into 64th bit? */
+              unlikely((offset > 0) && ((uint32_t)(offset >> 50) != 0)) )
+    {
+        /*
+         * Linux workaround: occasionally we will see timeouts a long way in 
+         * the future due to wrapping in Linux's jiffy time handling. We check 
+         * for timeouts wrapped negative, and for positive timeouts more than 
+         * about 13 days in the future (2^50ns). The correct fix is to trigger 
+         * an interrupt immediately (since Linux in fact has pending work to 
+         * do in this situation).
+         */
+        DPRINTK("Warning: huge timeout set by domain %d (vcpu %d):"
+                " %"PRIx64"\n",
+                v->domain->domain_id, v->vcpu_id, (uint64_t)timeout);
+        send_timer_event(v);
+    }
     else
     {
-        if ( unlikely(timeout < 0) ||
-             unlikely((uint32_t)((timeout - NOW()) >> 50) != 0) )
-        {
-            /*
-             * Linux workaround: occasionally we will see timeouts a long way
-             * in the future due to wrapping in Linux's jiffy time handling.
-             * We check for tiemouts wrapped negative, and for positive
-             * timeouts more than about 13 days in the future (2^50ns).
-             * The correct fix is to trigger an interrupt in a short while
-             * (since Linux in fact has pending work to do in this situation).
-             */
-            DPRINTK("Warning: huge timeout set by domain %d (vcpu %d):"
-                    " %"PRIx64"\n",
-                    v->domain->domain_id, v->vcpu_id, (uint64_t)timeout);
-            timeout = NOW() + MILLISECS(10);
-        }
-
         set_timer(&v->timer, timeout);
     }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEN] Fix the timeout workaround so it doesn't capture negative, Xen patchbot-unstable <=