From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: [PATCH 2/2] kvm: skip system call when msi route is unchanged Date: Tue, 4 Jun 2013 14:52:35 +0300 Message-ID: <1370346682-22970-2-git-send-email-mst@redhat.com> References: <1370346682-22970-1-git-send-email-mst@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Gleb Natapov , Marcelo Tosatti , kvm@vger.kernel.org To: qemu-devel@nongnu.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:9236 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753109Ab3FDLwC (ORCPT ); Tue, 4 Jun 2013 07:52:02 -0400 Content-Disposition: inline In-Reply-To: <1370346682-22970-1-git-send-email-mst@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 --- kvm-all.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- MST