Patchwork [PULL,07/21] kvm: skip system call when msi route is unchanged

login
register
mail settings
Submitter Michael S. Tsirkin
Date June 20, 2013, 1:10 p.m.
Message ID <1371730033-5554-8-git-send-email-mst@redhat.com>
Download mbox | patch
Permalink /patch/252912/
State New
Headers show

Comments

Michael S. Tsirkin - June 20, 2013, 1:10 p.m.
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>
---
 kvm-all.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch

diff --git a/kvm-all.c b/kvm-all.c
index f119ce1..891722b 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1026,6 +1026,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);