From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuIgD-0000P2-F0 for qemu-devel@nongnu.org; Wed, 03 Jul 2013 04:44:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UuIgC-0007Wm-8c for qemu-devel@nongnu.org; Wed, 03 Jul 2013 04:44:49 -0400 Received: from mail-bk0-x22f.google.com ([2a00:1450:4008:c01::22f]:65245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuIgC-0007WU-2f for qemu-devel@nongnu.org; Wed, 03 Jul 2013 04:44:48 -0400 Received: by mail-bk0-f47.google.com with SMTP id jg1so2731374bkc.20 for ; Wed, 03 Jul 2013 01:44:47 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Wed, 3 Jul 2013 10:44:30 +0200 Message-Id: <1372841072-22265-4-git-send-email-pbonzini@redhat.com> In-Reply-To: <1372841072-22265-1-git-send-email-pbonzini@redhat.com> References: <1372841072-22265-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 3/5] kvm: skip system call when msi route is unchanged List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, gleb@redhat.com, "Michael S. Tsirkin" From: "Michael S. Tsirkin" 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)" Signed-off-by: Michael S. Tsirkin Signed-off-by: Gleb Natapov --- 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