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] [HVM] Don't count "missed ticks" on one-s

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [HVM] Don't count "missed ticks" on one-shot timers.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 26 Sep 2007 03:41:18 -0700
Delivery-date: Wed, 26 Sep 2007 04:27:46 -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 Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1190637869 -3600
# Node ID c0d1825f51899b329495efb2078dd15e0fb3b479
# Parent  d17532dc1725e58b787329f64ce2e4e0e79516f0
[HVM] Don't count "missed ticks" on one-shot timers.
It's not clear what it would mean, and it leads to division by zero.
Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/vpt.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff -r d17532dc1725 -r c0d1825f5189 xen/arch/x86/hvm/vpt.c
--- a/xen/arch/x86/hvm/vpt.c    Sun Sep 23 12:56:11 2007 +0100
+++ b/xen/arch/x86/hvm/vpt.c    Mon Sep 24 13:44:29 2007 +0100
@@ -46,6 +46,9 @@ static void missed_ticks(struct periodic
 {
     s_time_t missed_ticks;
 
+    if ( unlikely(pt->one_shot) )
+        return;
+
     missed_ticks = NOW() - pt->scheduled;
     if ( missed_ticks <= 0 )
         return;
@@ -111,12 +114,18 @@ static void pt_timer_fn(void *data)
     pt_lock(pt);
 
     pt->pending_intr_nr++;
-    pt->scheduled += pt->period;
-
-    missed_ticks(pt);
-
-    if ( !pt->one_shot )
+
+    if ( unlikely(pt->one_shot) )
+    {
+        pt->enabled = 0;
+        list_del(&pt->list);
+    }
+    else
+    {
+        pt->scheduled += pt->period;
+        missed_ticks(pt);
         set_timer(&pt->timer, pt->scheduled);
+    }
 
     vcpu_kick(pt->vcpu);
 

_______________________________________________
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] [HVM] Don't count "missed ticks" on one-shot timers., Xen patchbot-unstable <=