qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com, gleb@redhat.com,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] [PATCH 3/5] kvm: skip system call when msi route is unchanged
Date: Wed,  3 Jul 2013 10:44:30 +0200	[thread overview]
Message-ID: <1372841072-22265-4-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1372841072-22265-1-git-send-email-pbonzini@redhat.com>

From: "Michael S. Tsirkin" <mst@redhat.com>

Some guests do a large number of mask/unmask
calls which currently trigger expensive route update
system calls.
Detect that route in unchanged and skip the system call.

Reported-by: "Zhanghaoyu (A)" <haoyu.zhang@huawei.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
 kvm-all.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kvm-all.c b/kvm-all.c
index 745b501..3ee0ac7 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1034,6 +1034,10 @@ static int kvm_update_routing_entry(KVMState *s,
             continue;
         }
 
+        if(!memcmp(entry, new_entry, sizeof *entry)) {
+            return 0;
+        }
+
         *entry = *new_entry;
 
         kvm_irqchip_commit_routes(s);
-- 
1.8.1.4

  parent reply	other threads:[~2013-07-03  8:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-03  8:44 [Qemu-devel] [PULL 0/5] KVM changes for 2013-07-03 Paolo Bonzini
2013-07-03  8:44 ` [Qemu-devel] [PATCH 1/5] kvm: add detail error message when fail to add ioeventfd Paolo Bonzini
2013-07-03  8:44 ` [Qemu-devel] [PATCH 2/5] kvm: zero-initialize KVM_SET_GSI_ROUTING input Paolo Bonzini
2013-07-03  8:44 ` Paolo Bonzini [this message]
2013-07-03  8:44 ` [Qemu-devel] [PATCH 4/5] pci-assign: remove the duplicate function name in debug message Paolo Bonzini
2013-07-03  8:44 ` [Qemu-devel] [PATCH 5/5] kvmclock: clock should count only if vm is running 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=1372841072-22265-4-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=gleb@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.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 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).