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

RE: [Xen-devel] [PATCH 1/2] cpu steal time accounting


  • To: "Rik van Riel" <riel@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
  • Date: Tue, 21 Feb 2006 17:05:43 +0800
  • Delivery-date: Tue, 21 Feb 2006 09:19:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcY2gWEHI9hYR+rrSManuNTYTdlLCAARDzdg
  • Thread-topic: [Xen-devel] [PATCH 1/2] cpu steal time accounting

Why do you need to add a new VCPUOP while doing same thing as DOM0_GETVCPUINFO?

Thanks,
Kevin

>-----Original Message-----
>From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>[mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Rik van Riel
>Sent: 2006年2月21日 8:51
>To: xen-devel@xxxxxxxxxxxxxxxxxxx
>Subject: [Xen-devel] [PATCH 1/2] cpu steal time accounting
>
>Allow guest domains to get information from the hypervisor on how much
>cpu time their virtual cpus have used.  This is needed to estimate the
>cpu steal time.
>
>Signed-off-by: Rik van Riel <riel@xxxxxxxxxx>
>
>--- xen/include/public/vcpu.h.steal    2006-02-07 18:01:41.000000000 -0500
>+++ xen/include/public/vcpu.h  2006-02-17 13:51:45.000000000 -0500
>@@ -51,6 +51,14 @@
> /* Returns 1 if the given VCPU is up. */
> #define VCPUOP_is_up                3
>
>+/*
>+ * Get information on how much CPU time this VCPU has used, etc...
>+ *
>+ * @extra_arg == pointer to an empty dom0_getvcpuinfo_t, the "OUT" variables
>+ *               of which filled in with scheduler info.
>+ */
>+#define VCPUOP_cpu_info             4
>+
> #endif /* __XEN_PUBLIC_VCPU_H__ */
>
> /*
>--- xen/common/domain.c.steal  2006-02-07 18:01:40.000000000 -0500
>+++ xen/common/domain.c        2006-02-17 13:52:44.000000000 -0500
>@@ -451,8 +451,24 @@
>     case VCPUOP_is_up:
>         rc = !test_bit(_VCPUF_down, &v->vcpu_flags);
>         break;
>+
>+    case VCPUOP_cpu_info:
>+      {
>+          struct dom0_getvcpuinfo vi = { 0, };
>+          vi.online = !test_bit(_VCPUF_down, &v->vcpu_flags);
>+          vi.blocked = test_bit(_VCPUF_blocked, &v->vcpu_flags);
>+          vi.running  = test_bit(_VCPUF_running, &v->vcpu_flags);
>+          vi.cpu_time = v->cpu_time;
>+          vi.cpu = v->processor;
>+          rc = 0;
>+
>+          if ( copy_to_user(arg, &vi, sizeof(dom0_getvcpuinfo_t)) )
>+              rc = -EFAULT;
>+          break;
>+      }
>     }
>
>+
>     return rc;
> }
>
>
>_______________________________________________
>Xen-devel mailing list
>Xen-devel@xxxxxxxxxxxxxxxxxxx
>http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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