[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • 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
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • 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();

Attachment: idle_runstate.patch
Description: idle_runstate.patch

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.