From: Paolo Bonzini <pbonzini@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: gleb@kernel.org, thomas knych <thomaswk@google.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>,
qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PULL 7/9] KVM: Retry KVM_CREATE_VM on EINTR
Date: Mon, 27 Jan 2014 14:53:31 +0100 [thread overview]
Message-ID: <52E664DB.4030503@redhat.com> (raw)
In-Reply-To: <2C8CC4E0-C561-4904-B256-476BECCA7F4A@suse.de>
Il 27/01/2014 14:44, Alexander Graf ha scritto:
>
> On 20.01.2014, at 15:44, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>> From: thomas knych <thomaswk@google.com>
>>
>> Upstreaming this change from Android (https://android-review.googlesource.com/54211).
>>
>> On heavily loaded machines with many VM instances we see KVM_CREATE_VM
>> failing with EINTR on this path:
>>
>> kvm_dev_ioctl_create_vm -> kvm_create_vm -> kvm_init_mmu_notifier -> mmu_notifier_register -> do_mmu_notifier_register -> mm_take_all_locks
>>
>> which checks if any signals have been raised while it was attaining locks
>> and returns EINTR. Retrying the system call greatly improves reliability.
>>
>> Cc: qemu-stable@nongnu.org
>> Signed-off-by: thomas knych <thomaswk@google.com>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>> kvm-all.c | 12 +++++++++---
>> 1 file changed, 9 insertions(+), 3 deletions(-)
>>
>> diff --git a/kvm-all.c b/kvm-all.c
>> index 3937754..6df2ee1 100644
>> --- a/kvm-all.c
>> +++ b/kvm-all.c
>> @@ -1442,16 +1442,22 @@ int kvm_init(void)
>> nc++;
>> }
>>
>> - s->vmfd = kvm_ioctl(s, KVM_CREATE_VM, 0);
>> - if (s->vmfd < 0) {
>> + do {
>> + ret = kvm_ioctl(s, KVM_CREATE_VM, 0);
>> + } while (ret == -EINTR);
>> +
>> + if (ret < 0) {
>> + fprintf(stderr, "ioctl(KVM_CREATE_VM) failed: %d %s\n", -s->vmfd,
>
> Shouldn't this be -ret?
Yes. Can you send a patch?
Paolo
next prev parent reply other threads:[~2014-01-27 13:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-20 14:44 [Qemu-devel] [PULL 0/8] KVM uq/master changes for 2014-01-20 Paolo Bonzini
2014-01-20 14:44 ` [Qemu-devel] [PULL 1/9] target-i386: Intel MPX Paolo Bonzini
2014-01-20 14:44 ` [Qemu-devel] [PULL 2/9] target-i386: do not special case TSC writeback Paolo Bonzini
2014-01-20 14:44 ` [Qemu-devel] [PULL 3/9] target-i386: clear guest TSC on reset Paolo Bonzini
2014-01-20 14:44 ` [Qemu-devel] [PULL 4/9] roms: Flush icache when writing roms to guest memory Paolo Bonzini
2014-01-20 14:44 ` [Qemu-devel] [PULL 5/9] kvm: x86: Separately write feature control MSR on reset Paolo Bonzini
2014-01-20 14:44 ` [Qemu-devel] [PULL 6/9] mempath prefault: fix off-by-one error Paolo Bonzini
2014-01-20 14:44 ` [Qemu-devel] [PULL 7/9] KVM: Retry KVM_CREATE_VM on EINTR Paolo Bonzini
2014-01-27 13:44 ` Alexander Graf
2014-01-27 13:53 ` Paolo Bonzini [this message]
2014-01-20 14:44 ` [Qemu-devel] [PULL 8/9] KVM: fix addr type for KVM_IOEVENTFD Paolo Bonzini
2014-01-20 14:44 ` [Qemu-devel] [PULL 9/9] kvm: always update the MPX model specific register Paolo Bonzini
2014-01-22 4:48 ` Liu, Jinsong
2014-01-20 14:47 ` [Qemu-devel] [PULL 0/8] KVM uq/master changes for 2014-01-20 Paolo Bonzini
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=52E664DB.4030503@redhat.com \
--to=pbonzini@redhat.com \
--cc=agraf@suse.de \
--cc=gleb@kernel.org \
--cc=mtosatti@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=thomaswk@google.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).