WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] qemu-dm performance

To: Tommie McAfee <tommie.mcafee@xxxxxxxxxx>
Subject: Re: [Xen-devel] qemu-dm performance
From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Date: Wed, 20 Sep 2006 22:03:27 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 20 Sep 2006 14:03:57 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1158782504.4960.142.camel@mah-chine>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1158782504.4960.142.camel@mah-chine>
Reply-to: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
On Wed, Sep 20, 2006 at 04:01:44PM -0400, Tommie McAfee wrote:
> Also, where else should I look in the code for possible explanations to
> why qemu-dm uses 20% CPU simply to view a guest.  All comments and
> suggestions regarding this matter are appreciated,

Rather than looking at the code, try using a profiling tool like OProfile
to instrument exactly where the runtime is going. For example running it
against qemu-dm instance on my Fedora Core 6 Xen host shows the following
top hot-spots:

# opcontrol --setup --separate=library,kernel \
     --vmlinux=/usr/lib/debug/lib/modules/2.6.17-1.2647.fc6/vmlinux \
     -e CPU_CLK_UNHALTED:100000:
# opcontrol --start
# opreport /usr/lib64/xen/bin/qemu-dm -a -l 2>/dev/null | head -7
Counted CPU_CLK_UNHALTED events (Cycles outside of halt state) with a unit mask 
of 0x00 (No unit mask) count 100000
samples  cum. samples  %        cum. %     image name               symbol name
391713   391713        56.1887  56.1887    qemu-dm                  vram_dirty
202108   593821        28.9911  85.1798    qemu-dm                  
_vnc_update_client
99266    693087        14.2391  99.4189    qemu-dm                  
vga_draw_line24_32
2023     695110         0.2902  99.7091    qemu-dm                  
vga_update_display

Fortunately this profile shows some clear hotspots to examine in greater
details - 3 sxamples accounting for 98% of all CPU time in qemu-dm
This is with a single VNC client connected, but not actively doing anything
in the guest framebuffer, using RHEL-3 as the fully-virt guest. 

If you have debuginfo available you can even get source file annotations
of where the hits are. For example, taking the 2nd hit there:

# opannotate /usr/lib64/xen/bin/qemu-dm --source -i _vnc_update_client 
....snip start of source....
 14800  1.5009 :                for (x = 0; x < X2DP_UP(vs, vs->ds->width); 
x++) {
  9928  1.0068 :                    if (vs->dirty_row[y] & (1ULL << x)) {
936343 94.9594 :                        if (memcmp(old_ptr, ptr, tile_bytes)) {
               :                            vs->has_update = 1;
     1 1.0e-04 :                            vs->update_row[y] |= (1ULL << x);
               :                            memcpy(old_ptr, ptr, tile_bytes);
               :                        }
 14513  1.4718 :                        vs->dirty_row[y] &= ~(1ULL << x);
               :                    }
               :
  4742  0.4809 :                    ptr += tile_bytes;
               :                    old_ptr += tile_bytes;
               :                }
......snip rest of source....

Regards,
Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

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

<Prev in Thread] Current Thread [Next in Thread>