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] x86, hvm: Clean up periodic timer code a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86, hvm: Clean up periodic timer code a little. This leads naturally
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 09 Nov 2007 04:21:03 -0800
Delivery-date: Fri, 09 Nov 2007 05:29:43 -0800
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 Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1194517998 0
# Node ID 8ff5bb70136dbb8ae4a725400334f4bff3643ba8
# Parent  6d7ea0cf6e5b16529bce7cb25ec9c7d22b86dc83
x86, hvm: Clean up periodic timer code a little. This leads naturally
to a no-missed-tick-accounting mode which is a combination of ticks
delivered 'off beat' immediately upon re-scheduling when ticks are
missed, then reverting to delivering ticks 'on beat' as usual.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/vpt.c |   26 ++++++++++----------------
 1 files changed, 10 insertions(+), 16 deletions(-)

diff -r 6d7ea0cf6e5b -r 8ff5bb70136d xen/arch/x86/hvm/vpt.c
--- a/xen/arch/x86/hvm/vpt.c    Thu Nov 08 10:23:22 2007 +0000
+++ b/xen/arch/x86/hvm/vpt.c    Thu Nov 08 10:33:18 2007 +0000
@@ -56,17 +56,9 @@ static void pt_process_missed_ticks(stru
     if ( missed_ticks <= 0 )
         return;
 
-    if ( mode_is(pt->vcpu->domain, no_missed_tick_accounting) )
-    {
-        pt->pending_intr_nr = 1;
-        pt->scheduled = now + pt->period;
-    }
-    else
-    {
-        missed_ticks = missed_ticks / (s_time_t) pt->period + 1;
-        pt->pending_intr_nr += missed_ticks;
-        pt->scheduled += missed_ticks * pt->period;
-    }
+    missed_ticks = missed_ticks / (s_time_t) pt->period + 1;
+    pt->pending_intr_nr += missed_ticks;
+    pt->scheduled += missed_ticks * pt->period;
 }
 
 static void pt_freeze_time(struct vcpu *v)
@@ -131,10 +123,7 @@ static void pt_timer_fn(void *data)
 
     pt_lock(pt);
 
-    if ( mode_is(pt->vcpu->domain, no_missed_tick_accounting) )
-        pt->pending_intr_nr = 1;
-    else
-        pt->pending_intr_nr++;
+    pt->pending_intr_nr++;
 
     if ( !pt->one_shot )
     {
@@ -235,11 +224,16 @@ void pt_intr_post(struct vcpu *v, struct
     }
     else
     {
-        pt->pending_intr_nr--;
         if ( mode_is(v->domain, no_missed_tick_accounting) )
+        {
             pt->last_plt_gtime = hvm_get_guest_time(v);
+            pt->pending_intr_nr = 0; /* 'collapse' all missed ticks */
+        }
         else
+        {
             pt->last_plt_gtime += pt->period_cycles;
+            pt->pending_intr_nr--;
+        }
     }
 
     if ( mode_is(v->domain, delay_for_missed_ticks) &&

_______________________________________________
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] x86, hvm: Clean up periodic timer code a little. This leads naturally, Xen patchbot-unstable <=