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] Initialize state_entry_time to zero for a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Initialize state_entry_time to zero for all idle vcpus
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 16 Dec 2008 22:30:21 -0800
Delivery-date: Tue, 16 Dec 2008 22:30:40 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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.fraser@xxxxxxxxxx>
# Date 1228916494 0
# Node ID 2a349db39496263fb326af12042c8ebdf421b071
# Parent  415a69b41397923ec27c5b8a821e72b5eb0d4e53
Initialize state_entry_time to zero for all idle vcpus

NOW() is not usable since xen time sub-system hasn't
been initialized yet. On my box, it gives a initial
stamp ~60s due to local tsc stamp as zero and TSC
count is started from power on. Then a negative value
is added to runstate of that idle vcpu at schedule
point. The net effect is for some tool like xenpm
to show a big idle time gap between BSP and other APs.

Signed-off-by: Kevin Tian <kevin.tian@xxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/common/domain.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff -r 415a69b41397 -r 2a349db39496 xen/common/domain.c
--- a/xen/common/domain.c       Wed Dec 10 13:30:10 2008 +0000
+++ b/xen/common/domain.c       Wed Dec 10 13:41:34 2008 +0000
@@ -144,13 +144,16 @@ struct vcpu *alloc_vcpu(
     v->domain = d;
     v->vcpu_id = vcpu_id;
 
-    v->runstate.state = is_idle_vcpu(v) ? RUNSTATE_running : RUNSTATE_offline;
-    v->runstate.state_entry_time = NOW();
-
     spin_lock_init(&v->virq_lock);
 
-    if ( !is_idle_domain(d) )
-    {
+    if ( is_idle_domain(d) )
+    {
+        v->runstate.state = RUNSTATE_running;
+    }
+    else
+    {
+        v->runstate.state = RUNSTATE_offline;        
+        v->runstate.state_entry_time = NOW();
         set_bit(_VPF_down, &v->pause_flags);
         v->vcpu_info = (void *)&shared_info(d, vcpu_info[vcpu_id]);
     }

_______________________________________________
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] Initialize state_entry_time to zero for all idle vcpus, Xen patchbot-unstable <=