From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrVcH-0002Lt-Qs for qemu-devel@nongnu.org; Tue, 25 Jun 2013 11:57:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrVLy-0001rP-Rz for qemu-devel@nongnu.org; Tue, 25 Jun 2013 11:40:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrVLy-0001r6-Im for qemu-devel@nongnu.org; Tue, 25 Jun 2013 11:40:22 -0400 Date: Tue, 25 Jun 2013 18:41:08 +0300 From: "Michael S. Tsirkin" Message-ID: <1372174719-6564-8-git-send-email-mst@redhat.com> References: <1372174719-6564-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1372174719-6564-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL v2 07/21] 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: Paolo Bonzini , kvm@vger.kernel.org, Gleb Natapov 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