All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Tommie McAfee <tommie.mcafee@unisys.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: qemu-dm performance
Date: Wed, 20 Sep 2006 22:03:27 +0100	[thread overview]
Message-ID: <20060920210327.GG4273@redhat.com> (raw)
In-Reply-To: <1158782504.4960.142.camel@mah-chine>

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  -=| 

  parent reply	other threads:[~2006-09-20 21:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-20 20:01 qemu-dm performance Tommie McAfee
2006-09-20 20:12 ` Anthony Liguori
2006-09-20 21:03 ` Daniel P. Berrange [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-09-20 21:39 Dugger, Donald D
2006-09-21 17:45 ` McAfee, Tommie M
2006-09-21 19:23   ` Steven Smith
2006-09-22 18:58     ` McAfee, Tommie M
2006-09-22 19:31       ` Steven Smith
2006-09-22 19:34 Dugger, Donald D

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060920210327.GG4273@redhat.com \
    --to=berrange@redhat.com \
    --cc=tommie.mcafee@unisys.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.