All of lore.kernel.org
 help / color / mirror / Atom feed
* xen-access performance from DomU
@ 2014-04-10 22:42 Bread Cutter
  2014-04-11 16:21 ` Bread Cutter
  0 siblings, 1 reply; 3+ messages in thread
From: Bread Cutter @ 2014-04-10 22:42 UTC (permalink / raw)
  To: Xen-devel

[-- Attachment #1: Type: text/plain, Size: 870 bytes --]

Hello all,

I'm having a performance issue with the xen-access API from DomU.

First of all, I've changed xen/include/xsm/dummy.h so that all
permissions are allowed. This is temporary and for testing, simply so
that I could run xen-access from DomU. I've also changed
tools/tests/xen-access/xen-access.c (patch attached) so that I monitor
cr3 writes. This was just something that happens consistently enough
for comparing performance. The actual value of cr3 isn't important for
my testing.

When I run xenaccess in Dom0, the target HVM domain runs pretty
smoothly. I can launch programs and Windows feels pretty responsive.

However, when I run the same tool from a PV-DomU, the target domain
becomes extremely sluggish. Launching a web browser takes a long time,
for example, and it's essentially unusable.

Can anyone offer any insight, and/or a remedy?

Thank you!

[-- Attachment #2: xen-access_cr3.patch --]
[-- Type: text/x-patch, Size: 2397 bytes --]

diff -rupN xen-access/xen-access.c xen-access.patched/xen-access.c
--- xen-access/xen-access.c	2014-03-10 06:43:57.000000000 -0400
+++ xen-access.patched/xen-access.c	2014-04-10 18:35:35.627808719 -0400
@@ -449,7 +449,7 @@ static int xenaccess_resume_page(xenacce
 void usage(char* progname)
 {
     fprintf(stderr,
-            "Usage: %s [-m] <domain_id> write|exec|int3\n"
+            "Usage: %s [-m] <domain_id> write|exec|int3|cr3\n"
             "\n"
             "Logs first page writes, execs, or int3 traps that occur on the domain.\n"
             "\n"
@@ -472,6 +472,7 @@ int main(int argc, char *argv[])
     int required = 0;
     int int3 = 0;
     int shutting_down = 0;
+    int cr3 = 0;
 
     char* progname = argv[0];
     argv++;
@@ -513,6 +514,10 @@ int main(int argc, char *argv[])
     else if ( !strcmp(argv[0], "int3") )
     {
         int3 = 1;
+    } 
+    else if ( !strcmp(argv[0], "cr3") )
+    {
+        cr3 = 1;
     }
     else
     {
@@ -573,6 +578,16 @@ int main(int argc, char *argv[])
         goto exit;
     }
 
+    if ( cr3 )
+        rc = xc_set_hvm_param(xch, domain_id, HVM_PARAM_MEMORY_EVENT_CR3, HVMPME_mode_sync);
+    else
+        rc = xc_set_hvm_param(xch, domain_id, HVM_PARAM_MEMORY_EVENT_CR3, HVMPME_mode_disabled);
+    if ( rc < 0 )
+    {
+        ERROR("Error %d setting cr3 mem_event\n", rc);
+        goto exit;
+    }
+
     /* Wait for access */
     for (;;)
     {
@@ -584,7 +599,7 @@ int main(int argc, char *argv[])
             rc = xc_hvm_set_mem_access(xch, domain_id, HVMMEM_access_rwx, ~0ull, 0);
             rc = xc_hvm_set_mem_access(xch, domain_id, HVMMEM_access_rwx, 0, xenaccess->domain_info->max_pages);
             rc = xc_set_hvm_param(xch, domain_id, HVM_PARAM_MEMORY_EVENT_INT3, HVMPME_mode_disabled);
-
+            rc = xc_set_hvm_param(xch, domain_id, HVM_PARAM_MEMORY_EVENT_CR3, HVMPME_mode_disabled);
             shutting_down = 1;
         }
 
@@ -653,6 +668,12 @@ int main(int argc, char *argv[])
                 rsp.gfn = req.gfn;
                 rsp.p2mt = req.p2mt;
                 break;
+            case MEM_EVENT_REASON_CR3:
+		printf("CR3: rip=%016"PRIx64", gfn=%"PRIx64" (vcpu %d)\n",
+			req.gla,
+			req.gfn,
+			req.vcpu_id);
+		break;
             case MEM_EVENT_REASON_INT3:
                 printf("INT3: rip=%016"PRIx64", gfn=%"PRIx64" (vcpu %d)\n", 
                        req.gla, 

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: xen-access performance from DomU
  2014-04-10 22:42 xen-access performance from DomU Bread Cutter
@ 2014-04-11 16:21 ` Bread Cutter
  2014-04-15 15:19   ` Bread Cutter
  0 siblings, 1 reply; 3+ messages in thread
From: Bread Cutter @ 2014-04-11 16:21 UTC (permalink / raw)
  To: Xen-devel

By the way, this is with Xen-4.4 (although I had the same issue on
4.3), running Ubuntu 13.10 Saucy with kernel 3.11.0-19-generic.

On Thu, Apr 10, 2014 at 6:42 PM, Bread Cutter <cutter409@gmail.com> wrote:
> Hello all,
>
> I'm having a performance issue with the xen-access API from DomU.
>
> First of all, I've changed xen/include/xsm/dummy.h so that all
> permissions are allowed. This is temporary and for testing, simply so
> that I could run xen-access from DomU. I've also changed
> tools/tests/xen-access/xen-access.c (patch attached) so that I monitor
> cr3 writes. This was just something that happens consistently enough
> for comparing performance. The actual value of cr3 isn't important for
> my testing.
>
> When I run xenaccess in Dom0, the target HVM domain runs pretty
> smoothly. I can launch programs and Windows feels pretty responsive.
>
> However, when I run the same tool from a PV-DomU, the target domain
> becomes extremely sluggish. Launching a web browser takes a long time,
> for example, and it's essentially unusable.
>
> Can anyone offer any insight, and/or a remedy?
>
> Thank you!

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

* Re: xen-access performance from DomU
  2014-04-11 16:21 ` Bread Cutter
@ 2014-04-15 15:19   ` Bread Cutter
  0 siblings, 0 replies; 3+ messages in thread
From: Bread Cutter @ 2014-04-15 15:19 UTC (permalink / raw)
  To: Xen-devel

I've tried upgrading DomU to Ubuntu 14.04 to get kernel
3.13.0-24-generic, since I saw some changes to the evtch module, but
it didn't make a difference. I also saw somewhere to try OpenSUSE
because of kernel support for "Suspend event channels", but I can't
find much about what those actually are. In any case, an OpenSUSE DomU
did not help.

On Fri, Apr 11, 2014 at 12:21 PM, Bread Cutter <cutter409@gmail.com> wrote:
> By the way, this is with Xen-4.4 (although I had the same issue on
> 4.3), running Ubuntu 13.10 Saucy with kernel 3.11.0-19-generic.
>
> On Thu, Apr 10, 2014 at 6:42 PM, Bread Cutter <cutter409@gmail.com> wrote:
>> Hello all,
>>
>> I'm having a performance issue with the xen-access API from DomU.
>>
>> First of all, I've changed xen/include/xsm/dummy.h so that all
>> permissions are allowed. This is temporary and for testing, simply so
>> that I could run xen-access from DomU. I've also changed
>> tools/tests/xen-access/xen-access.c (patch attached) so that I monitor
>> cr3 writes. This was just something that happens consistently enough
>> for comparing performance. The actual value of cr3 isn't important for
>> my testing.
>>
>> When I run xenaccess in Dom0, the target HVM domain runs pretty
>> smoothly. I can launch programs and Windows feels pretty responsive.
>>
>> However, when I run the same tool from a PV-DomU, the target domain
>> becomes extremely sluggish. Launching a web browser takes a long time,
>> for example, and it's essentially unusable.
>>
>> Can anyone offer any insight, and/or a remedy?
>>
>> Thank you!

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

end of thread, other threads:[~2014-04-15 15:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-10 22:42 xen-access performance from DomU Bread Cutter
2014-04-11 16:21 ` Bread Cutter
2014-04-15 15:19   ` Bread Cutter

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.