All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH 1/2] cpu steal time accounting
@ 2006-02-21 14:06 Tian, Kevin
  0 siblings, 0 replies; 20+ messages in thread
From: Tian, Kevin @ 2006-02-21 14:06 UTC (permalink / raw)
  To: Rik van Riel; +Cc: xen-devel

>From: Rik van Riel [mailto:riel@redhat.com]
>Sent: 2006年2月21日 20:56
>
>On Tue, 21 Feb 2006, Tian, Kevin wrote:
>
>> Why do you need to add a new VCPUOP while doing same thing as
>> DOM0_GETVCPUINFO?
>
>Because the dom0_ops only work for dom0 and reworking that
>function to allow non-privileged domains to get info just
>on themselves would end up being a way uglier patch.
>

See your point now. Since physical processor id is also exported in your patch, will it cause a trend to allow non-privileged domain to query more physical context information about domain itself? Like GETDOMAININFO, GETVCPUCONTEXT, etc. For example, guest may use gap info between max_pages and tot_pages to decide whether eagerly adding free pages as caches. It can also consider that info as an indicator of some type of tight resource contention. If it's the usage model, maybe we can consider move them out of dom0_ prefix and make it common.

Thanks,
Kevin

^ permalink raw reply	[flat|nested] 20+ messages in thread
* RE: [PATCH 1/2] cpu steal time accounting
@ 2006-02-21  9:05 Tian, Kevin
  2006-02-21 12:56 ` Rik van Riel
  0 siblings, 1 reply; 20+ messages in thread
From: Tian, Kevin @ 2006-02-21  9:05 UTC (permalink / raw)
  To: Rik van Riel, xen-devel

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

Thanks,
Kevin

>-----Original Message-----
>From: xen-devel-bounces@lists.xensource.com
>[mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Rik van Riel
>Sent: 2006年2月21日 8:51
>To: xen-devel@lists.xensource.com
>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@redhat.com>
>
>--- 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@lists.xensource.com
>http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 20+ messages in thread
* [PATCH 1/2] cpu steal time accounting
@ 2006-02-21  0:51 Rik van Riel
  2006-02-21 17:42 ` Keir Fraser
  0 siblings, 1 reply; 20+ messages in thread
From: Rik van Riel @ 2006-02-21  0:51 UTC (permalink / raw)
  To: xen-devel

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@redhat.com>

--- 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;
 }

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2006-02-24 19:04 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <43FCCB2C.5000408@vmware.com>
2006-02-22 23:58 ` [PATCH 1/2] cpu steal time accounting Dan Hecht
2006-02-23  8:40   ` Keir Fraser
2006-02-23 18:17     ` Dan Hecht
2006-02-23  8:48   ` Keir Fraser
2006-02-23 10:04     ` Keir Fraser
2006-02-23 19:43       ` Dan Hecht
2006-02-23 13:18     ` Rik van Riel
2006-02-21 14:06 Tian, Kevin
  -- strict thread matches above, loose matches on Subject: below --
2006-02-21  9:05 Tian, Kevin
2006-02-21 12:56 ` Rik van Riel
2006-02-21  0:51 Rik van Riel
2006-02-21 17:42 ` Keir Fraser
2006-02-21 19:32   ` Rik van Riel
2006-02-21 21:24     ` Diwaker Gupta
2006-02-22  9:00     ` Keir Fraser
2006-02-22 14:27       ` Rik van Riel
2006-02-22 17:08         ` Keir Fraser
2006-02-22 17:11           ` Rik van Riel
2006-02-22 17:45             ` Keir Fraser
2006-02-24 19:04               ` Rik van Riel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.