From: Jan Kiszka <jan.kiszka@web.de>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
kvm@vger.kernel.org, gleb@kernel.org, pbonzini@redhat.com
Subject: Re: nested KVM slower than QEMU with gnumach guest kernel
Date: Mon, 17 Nov 2014 07:28:23 +0100 [thread overview]
Message-ID: <54699587.9040109@web.de> (raw)
In-Reply-To: <20141116221828.GA13123@type>
[-- Attachment #1: Type: text/plain, Size: 2365 bytes --]
On 2014-11-16 23:18, Samuel Thibault wrote:
> Hello,
>
> Jan Kiszka, le Wed 12 Nov 2014 00:42:52 +0100, a écrit :
>> On 2014-11-11 19:55, Samuel Thibault wrote:
>>> jenkins.debian.net is running inside a KVM VM, and it runs nested
>>> KVM guests for its installation attempts. This goes fine with Linux
>>> kernels, but it is extremely slow with gnumach kernels.
>
>> You can try to catch a trace (ftrace) on the physical host.
>>
>> I suspect the setup forces a lot of instruction emulation, either on L0
>> or L1. And that is slower than QEMU is KVM does not optimize like QEMU does.
>
> Here is a sample of trace-cmd output dump: the same kind of pattern
> repeats over and over, with EXTERNAL_INTERRUPT happening mostly
> every other microsecond:
>
> qemu-system-x86-9752 [003] 4106.187755: kvm_exit: reason EXTERNAL_INTERRUPT rip 0xffffffffa02848b1 info 0 800000f6
> qemu-system-x86-9752 [003] 4106.187756: kvm_entry: vcpu 0
> qemu-system-x86-9752 [003] 4106.187757: kvm_exit: reason EXTERNAL_INTERRUPT rip 0xffffffffa02848b1 info 0 800000f6
> qemu-system-x86-9752 [003] 4106.187758: kvm_entry: vcpu 0
> qemu-system-x86-9752 [003] 4106.187759: kvm_exit: reason EXTERNAL_INTERRUPT rip 0xffffffffa02848b1 info 0 800000f6
> qemu-system-x86-9752 [003] 4106.187760: kvm_entry: vcpu 0
You may want to turn on more trace events, if not all, to possibly see
what Linux does then. The next level after that is function tracing (may
require a kernel rebuild or a tracing kernel of the distro).
>
> The various functions being interrupted are vmx_vcpu_run
> (0xffffffffa02848b1 and 0xffffffffa0284972), handle_io
> (0xffffffffa027ee62), vmx_get_cpl (0xffffffffa027a7de),
> load_vmc12_host_state (0xffffffffa027ea31), native_read_tscp
> (0xffffffff81050a84), native_write_msr_safe (0xffffffff81050aa6),
> vmx_decache_cr0_guest_bits (0xffffffffa027a384),
> vmx_handle_external_intr (0xffffffffa027a54d).
>
> AIUI, the external interrupt is 0xf6, i.e. Linux' IRQ_WORK_VECTOR. I
> however don't see any of them, neither in L0's /proc/interrupts, nor in
> L1's /proc/interrupts...
I suppose this is a SMP host and guest? Does reducing CPUs to 1 change
to picture? If not, it may help to understand cause and effect easier.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2014-11-17 6:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-11 18:55 nested KVM slower than QEMU with gnumach guest kernel Samuel Thibault
2014-11-11 23:42 ` Jan Kiszka
2014-11-16 22:18 ` Samuel Thibault
2014-11-17 6:28 ` Jan Kiszka [this message]
2014-11-17 8:50 ` Samuel Thibault
2014-11-24 0:42 ` Samuel Thibault
2014-12-15 0:09 ` Samuel Thibault
2014-12-15 9:41 ` Paolo Bonzini
2014-11-17 8:58 ` Gleb Natapov
2014-11-17 9:03 ` Samuel Thibault
2014-11-17 9:04 ` Jan Kiszka
2014-11-17 9:10 ` Samuel Thibault
2014-11-17 9:21 ` Gleb Natapov
2014-11-17 9:37 ` Samuel Thibault
2014-11-17 9:38 ` Samuel Thibault
2014-11-23 21:50 ` Samuel Thibault
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=54699587.9040109@web.de \
--to=jan.kiszka@web.de \
--cc=gleb@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=samuel.thibault@ens-lyon.org \
/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.