diff mbox

[3/5] kvm: skip system call when msi route is unchanged

Message ID 1372841072-22265-4-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini July 3, 2013, 8:44 a.m. UTC
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 mbox

Patch

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);