From: Stefan Hajnoczi <stefanha@gmail.com>
To: Zhang Haoyu <zhanghy@sangfor.com>
Cc: kvm <kvm@vger.kernel.org>, qemu-devel <qemu-devel@nongnu.org>,
Zhang Haoyu <ahzhanghaoyu@gmail.com>,
Max Reitz <mreitz@redhat.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Amit Shah <amit.shah@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [question] virtio-blk performance degradation happened with virito-serial
Date: Fri, 12 Sep 2014 13:38:57 +0100 [thread overview]
Message-ID: <20140912123857.GA6207@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <201409121121358332189@sangfor.com>
[-- Attachment #1: Type: text/plain, Size: 6938 bytes --]
On Fri, Sep 12, 2014 at 11:21:37AM +0800, Zhang Haoyu wrote:
> >>> > > If virtio-blk and virtio-serial share an IRQ, the guest operating system has to check each virtqueue for activity. Maybe there is some inefficiency doing that.
> >>> > > AFAIK virtio-serial registers 64 virtqueues (on 31 ports + console) even if everything is unused.
> >>> >
> >>> > That could be the case if MSI is disabled.
> >>>
> >>> Do the windows virtio drivers enable MSIs, in their inf file?
> >>
> >>It depends on the version of the drivers, but it is a reasonable guess
> >>at what differs between Linux and Windows. Haoyu, can you give us the
> >>output of lspci from a Linux guest?
> >>
> >I made a test with fio on rhel-6.5 guest, the same degradation happened too, this degradation can be reproduced on rhel6.5 guest 100%.
> >virtio_console module installed:
> >64K-write-sequence: 285 MBPS, 4380 IOPS
> >virtio_console module uninstalled:
> >64K-write-sequence: 370 MBPS, 5670 IOPS
> >
> I use top -d 1 -H -p <qemu-pid> to monitor the cpu usage, and found that,
> virtio_console module installed:
> qemu main thread cpu usage: 98%
> virtio_console module uninstalled:
> qemu main thread cpu usage: 60%
>
> perf top -p <qemu-pid> result,
> virtio_console module installed:
> PerfTop: 9868 irqs/sec kernel:76.4% exact: 0.0% [4000Hz cycles], (target_pid: 88381)
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> 11.80% [kernel] [k] _raw_spin_lock_irqsave
> 8.42% [kernel] [k] _raw_spin_unlock_irqrestore
> 7.33% [kernel] [k] fget_light
> 6.28% [kernel] [k] fput
> 3.61% [kernel] [k] do_sys_poll
> 3.30% qemu-system-x86_64 [.] qcow2_check_metadata_overlap
> 3.10% [kernel] [k] __pollwait
> 2.15% qemu-system-x86_64 [.] qemu_iohandler_poll
> 1.44% libglib-2.0.so.0.3200.4 [.] g_array_append_vals
> 1.36% libc-2.13.so [.] 0x000000000011fc2a
> 1.31% libpthread-2.13.so [.] pthread_mutex_lock
> 1.24% libglib-2.0.so.0.3200.4 [.] 0x000000000001f961
> 1.20% libpthread-2.13.so [.] __pthread_mutex_unlock_usercnt
> 0.99% [kernel] [k] eventfd_poll
> 0.98% [vdso] [.] 0x0000000000000771
> 0.97% [kernel] [k] remove_wait_queue
> 0.96% qemu-system-x86_64 [.] qemu_iohandler_fill
> 0.95% [kernel] [k] add_wait_queue
> 0.69% [kernel] [k] __srcu_read_lock
> 0.58% [kernel] [k] poll_freewait
> 0.57% [kernel] [k] _raw_spin_lock_irq
> 0.54% [kernel] [k] __srcu_read_unlock
> 0.47% [kernel] [k] copy_user_enhanced_fast_string
> 0.46% [kvm_intel] [k] vmx_vcpu_run
> 0.46% [kvm] [k] vcpu_enter_guest
> 0.42% [kernel] [k] tcp_poll
> 0.41% [kernel] [k] system_call_after_swapgs
> 0.40% libglib-2.0.so.0.3200.4 [.] g_slice_alloc
> 0.40% [kernel] [k] system_call
> 0.38% libpthread-2.13.so [.] 0x000000000000e18d
> 0.38% libglib-2.0.so.0.3200.4 [.] g_slice_free1
> 0.38% qemu-system-x86_64 [.] address_space_translate_internal
> 0.38% [kernel] [k] _raw_spin_lock
> 0.37% qemu-system-x86_64 [.] phys_page_find
> 0.36% [kernel] [k] get_page_from_freelist
> 0.35% [kernel] [k] sock_poll
> 0.34% [kernel] [k] fsnotify
> 0.31% libglib-2.0.so.0.3200.4 [.] g_main_context_check
> 0.30% [kernel] [k] do_direct_IO
> 0.29% libpthread-2.13.so [.] pthread_getspecific
>
> virtio_console module uninstalled:
> PerfTop: 9138 irqs/sec kernel:71.7% exact: 0.0% [4000Hz cycles], (target_pid: 88381)
> ------------------------------------------------------------------------------------------------------------------------------
>
> 5.72% qemu-system-x86_64 [.] qcow2_check_metadata_overlap
> 4.51% [kernel] [k] fget_light
> 3.98% [kernel] [k] _raw_spin_lock_irqsave
> 2.55% [kernel] [k] fput
> 2.48% libpthread-2.13.so [.] pthread_mutex_lock
> 2.46% [kernel] [k] _raw_spin_unlock_irqrestore
> 2.21% libpthread-2.13.so [.] __pthread_mutex_unlock_usercnt
> 1.71% [vdso] [.] 0x000000000000060c
> 1.68% libc-2.13.so [.] 0x00000000000e751f
> 1.64% libglib-2.0.so.0.3200.4 [.] 0x000000000004fca0
> 1.20% [kernel] [k] __srcu_read_lock
> 1.14% [kernel] [k] do_sys_poll
> 0.96% [kernel] [k] _raw_spin_lock_irq
> 0.95% [kernel] [k] __pollwait
> 0.91% [kernel] [k] __srcu_read_unlock
> 0.78% [kernel] [k] tcp_poll
> 0.74% [kvm] [k] vcpu_enter_guest
> 0.73% [kvm_intel] [k] vmx_vcpu_run
> 0.72% [kernel] [k] _raw_spin_lock
> 0.72% [kernel] [k] system_call_after_swapgs
> 0.70% [kernel] [k] copy_user_enhanced_fast_string
> 0.67% libglib-2.0.so.0.3200.4 [.] g_slice_free1
> 0.66% libpthread-2.13.so [.] 0x000000000000e12d
> 0.65% [kernel] [k] system_call
> 0.61% [kernel] [k] do_direct_IO
> 0.57% qemu-system-x86_64 [.] qemu_iohandler_poll
> 0.57% [kernel] [k] fsnotify
> 0.54% libglib-2.0.so.0.3200.4 [.] g_slice_alloc
> 0.50% [kernel] [k] vfs_write
> 0.49% libpthread-2.13.so [.] pthread_getspecific
> 0.48% qemu-system-x86_64 [.] qemu_event_reset
> 0.47% libglib-2.0.so.0.3200.4 [.] g_main_context_check
> 0.46% qemu-system-x86_64 [.] address_space_translate_internal
> 0.46% [kernel] [k] sock_poll
> 0.46% libpthread-2.13.so [.] __pthread_disable_asynccancel
> 0.44% [kernel] [k] resched_task
> 0.43% libpthread-2.13.so [.] __pthread_enable_asynccancel
> 0.42% qemu-system-x86_64 [.] phys_page_find
> 0.39% qemu-system-x86_64 [.] object_dynamic_cast_assert
Max: Unrelated to this performance issue but I notice that the qcow2
metadata overlap check is high in the host CPU profile. Have you had
any thoughts about optimizing the check?
Stefan
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2014-09-12 12:39 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-29 7:45 [Qemu-devel] [question] virtio-blk performance degradation happened with virito-serial Zhang Haoyu
2014-08-29 14:38 ` Amit Shah
2014-09-01 12:38 ` [Qemu-devel] [question] virtio-blk performance degradationhappened " Zhang Haoyu
2014-09-01 12:46 ` Amit Shah
2014-09-01 12:57 ` [Qemu-devel] [question] virtio-blk performancedegradationhappened " Zhang Haoyu
2014-09-01 12:52 ` [Qemu-devel] [question] virtio-blk performance degradationhappened " Zhang Haoyu
2014-09-01 13:09 ` Christian Borntraeger
2014-09-01 13:12 ` Paolo Bonzini
2014-09-01 13:22 ` Christian Borntraeger
2014-09-01 13:29 ` Paolo Bonzini
2014-09-01 14:03 ` Christian Borntraeger
2014-09-01 14:15 ` Christian Borntraeger
2014-09-04 7:56 ` [Qemu-devel] [question] virtio-blk performance degradationhappenedwith virito-serial Zhang Haoyu
2014-09-07 9:46 ` Zhang Haoyu
2014-09-11 6:11 ` Amit Shah
2014-09-12 3:21 ` [Qemu-devel] [question] virtio-blk performance degradation happened with virito-serial Zhang Haoyu
2014-09-12 12:38 ` Stefan Hajnoczi [this message]
2014-09-13 17:22 ` Max Reitz
2014-09-16 14:59 ` Zhang Haoyu
2014-09-02 6:36 ` [Qemu-devel] [question] virtio-blk performance degradationhappened " Amit Shah
2014-09-02 18:05 ` Andrey Korolyov
2014-09-02 18:11 ` Amit Shah
2014-09-02 18:27 ` Andrey Korolyov
2014-09-04 2:20 ` [Qemu-devel] [question] virtio-blk performancedegradationhappened " Zhang Haoyu
2014-09-19 5:53 ` [Qemu-devel] [question] virtio-blk performance degradationhappened " Fam Zheng
2014-09-19 13:35 ` Paolo Bonzini
2014-09-22 13:23 ` [Qemu-devel] [question] virtio-blk performancedegradationhappened " Zhang Haoyu
2014-09-23 1:29 ` Fam Zheng
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=20140912123857.GA6207@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=ahzhanghaoyu@gmail.com \
--cc=amit.shah@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=zhanghy@sangfor.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).