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

[Xen-devel] [PATCH] Initialize state_entry_time to zero for all idle vcp

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Initialize state_entry_time to zero for all idle vcpus
From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
Date: Wed, 10 Dec 2008 21:09:05 +0800
Accept-language: en-US
Acceptlanguage: en-US
Delivery-date: Wed, 10 Dec 2008 05:09:42 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AclayHpZltekFzInSHuyXY/uTzEo4A==
Thread-topic: [PATCH] Initialize state_entry_time to zero for all idle vcpus
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>

diff -r bf41be7bddea xen/common/domain.c
--- a/xen/common/domain.c       Mon Dec 01 14:46:11 2008 -0500
+++ b/xen/common/domain.c       Tue Dec 09 20:56:23 2008 -0500
@@ -135,7 +135,8 @@
     v->vcpu_id = vcpu_id;
 
     v->runstate.state = is_idle_vcpu(v) ? RUNSTATE_running : RUNSTATE_offline;
-    v->runstate.state_entry_time = NOW();
+    /* Don't use NOW() before xen time sub-system is intialized */
+    v->runstate.state_entry_time = is_idle_vcpu(v) ? 0 : NOW();
 
     spin_lock_init(&v->virq_lock);
 

Attachment: idle_runstate.patch
Description: idle_runstate.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Initialize state_entry_time to zero for all idle vcpus, Tian, Kevin <=