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

[Xen-devel] RE: qemu-dm cpu utilization



Anthony,

>You want to set it to NULL after a qemu_del_timer only in the connection
>teardown code.

Setting "ts->timer=NULL" and blocking access to this pointer in qemu_mod_timer 
seemed to resolve the issue.  When I close the vnc window qemu-dm drops to 0%.

Opening and closing  a connection to the guest with vncviewer doesn't seem to 
change the way time is being managed in the virtual machine.

Is this the right fix for this problem?

Signed-off-by: Tommie McAfee <tommie.mcafee@xxxxxxxxxx>

diff -r 8273f730371b tools/ioemu/vl.c
--- a/tools/ioemu/vl.c  Tue Aug 29 12:23:11 2006 +0100
+++ b/tools/ioemu/vl.c  Wed Aug 30 13:03:01 2006 -0400
@@ -731,6 +731,8 @@ void qemu_mod_timer(QEMUTimer *ts, int64
 {
     QEMUTimer **pt, *t;

+   if(!ts)
+       return;
     qemu_del_timer(ts);

     /* add the timer in the sorted list */
diff -r 8273f730371b tools/ioemu/vnc.c
--- a/tools/ioemu/vnc.c Tue Aug 29 12:23:11 2006 +0100
+++ b/tools/ioemu/vnc.c Wed Aug 30 13:03:01 2006 -0400
@@ -626,6 +626,7 @@ static int vnc_client_io_error(VncState
        buffer_reset(&vs->input);
        buffer_reset(&vs->output);
        vs->need_update = 0;
+       vs->timer=NULL;
        return 0;
     }
     return ret;

--------------------------



-----Original Message-----
From: Anthony Liguori [mailto:aliguori@xxxxxxxxxxxxx]
Sent: Wed 8/30/2006 5:05 PM
To: McAfee, Tommie M
Cc: Anthony Liguori; xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: qemu-dm cpu utilization
 
McAfee, Tommie M wrote:
> Anthony,
>
>   
>> If you delete the timer (and set vs->timer = NULL) in 
>> vnc_client_io_error(), does it reduce the usage?
>>     
>
> setting vs->timer=NULL causes qemu-dm to segfault

You want to set it to NULL after a qemu_del_timer only in the connection 
teardown code.

> According to strace, the timers account for a lot of qemu-dm's activity.
> Is this polling a bit excessive? 
>   

I don't fully understand the performance of qemu bits in qemu-dm.  
Christian could probably offer a better insight especially since I think 
he changed the normal timers a bit (at least the GUI timer).

When completely idle, qemu normally won't occupy that much CPU (often 
less than a few percent).  I'd expect it to be a little higher with qemu-dm.

Regards,

Anthony Liguori

> Tommie McAfee
> Xen-Testing 
>
>
>
> -----Original Message-----
> From: Anthony Liguori [mailto:anthony@xxxxxxxxxxxxx]
> Sent: Tue 8/29/2006 7:43 PM
> To: McAfee, Tommie M
> Subject: Re: qemu-dm cpu utilization
>  
> McAfee, Tommie M wrote:
>   
>> Using an 8-way ES7000 with 32GB of ram, I'm running xen at changset 11217
>> with dom0_mem=3092M as a kernel parameter on a x86_64 hyperviser.
>>
>> It appears that qemu is adding too much overhead to
>> virtual machines to display graphics.
>> If I boot a sles9sp3 domVT in runlevel 5 with vga=0x314 for a graphicalboot, 
>> and immediately use
>> vncviewer simply to watch the virtual machine as it boots,
>> qemu-dm consumes 40% cpu as soon as vncviewer is launched and remains that 
>> way throughout this entire process  without settling down when the login 
>> screen appears.
>> Even If I close the console that's viewing the virtual host,  qemu-dm 
>> remains at 40-44%.
>>     
>
> Almost everything in the VNC code resets when a guest disconnected 
> except for the timer.  If a client disconnects, the timer routine should 
> be almost a nop but it's possible that it's somehow causing qemu-dm to 
> do something funky.
>
> If you delete the timer (and set vs->timer = NULL) in 
> vnc_client_io_error(), does it reduce the usage?
>
> BTW, if you're using 800x600, I suspect that you may be falling back to 
> MMIO instead of a linear framebuffer.  Try moving to 1024x768 and see if 
> that helps.
>
> Regards,
>
> Anthony Liguori
>
>   
>> When booting the same domVT in runlevel 5 without ever attempting to connect 
>> to it with
>> vncviewer, qemu-dm fluctuated from 1-3% while the host was booting and then 
>> settled to 0.2% after 4-5 mins.  Assuming that the boot process was 
>> complete, I launched vncviewer and qemu-dm jumped up to a 40-44% range again.
>>
>> Lastly I started the same host in runlevel 3 in pure text mode without any
>> vga parameters on the kernel line, connected to the virtual machine with
>> vncviewer, and watched the machine boot until a login prompt appeared.  At
>> this point, top showed qemu-dm as using 0% of the cpu.  Logging into the
>> virtual machine and running 'startx' however sent qemu-dm back up to a 40-
>> 44% range.
>>
>> Why is qemu-dm consuming so much of the cpu?  Why is qemu-dm still high
>> even when I close my vncviewer?
>>
>> Tommie,
>> Xen Test Team
>> Unisys 
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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®.