]> git.proxmox.com Git - mirror_qemu.git/commitdiff
kvm: skip system call when msi route is unchanged
authorMichael S. Tsirkin <mst@redhat.com>
Tue, 4 Jun 2013 11:52:35 +0000 (14:52 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 3 Jul 2013 08:38:20 +0000 (10:38 +0200)
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

index 745b5017a15171ed162d6eef509199fd5b39002f..3ee0ac7e7bb1d82bb20a577f83e3e2094978fa9a 100644 (file)
--- 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);